I have a javascript array
var arr = ["value1", "value2", "value3", "value4", "value5"]
I want to convert it into JSON array to be sent over to server like this
{
"JSONarray": ["value1", "value2", "value3", "value4", "value5"]
}
Directly putting javascript array varible into the value doesn't help.
Tried JSON.stringify()
it converts the whole array into one giant string.
Is there any other approach to this problem?