196
rated 0 times
[
199]
[
3]
/ answers: 1 / hits: 21953
/ 10 Years ago, wed, march 5, 2014, 12:00:00
I have an array containing 3 elements
var a = [];
a[username]=$scope.username;
a[phoneNo]=$scope.phoneNo;
a[altPhoneNo]=$scope.altPhoneNo;
Now, I want to send this data to server in JSON format. Therefore, I used
var aa = JSON.stringify(a);
console.log(aa = +aa);
But the console displays empty array
aa = []
How can I convert this array into JSON?
More From » arrays