JSON stringify is not converting array to string
I am trying to convert a js array to json string. The array has "string" keys. JSON.stringify is not converting the array to string.
This is my code.
a=new Array();
a["k1"]="apple";
a["k2"]="berry";
t= JSON.stringify(a);
console.log(t);
//writes an empty [] to console.
from JavaScript https://ift.tt/2WAZZqQ
via IFTTT

0 Comments