I am new to JavaScript. I have done similar requirements in Java using org.json library.
I have a String:
var string = "{\"id\" :[\"\"],\"State\" :[\"TX\",\"IA\"]}";
I am converting that string to a JSONObject using this:
var obj = JSON.parse(string);
I am trying to achieve this using JavaScript or jQuery. How do i get the JSONArrays inside this JSONObject. Please help me. Thanks in advance.
JSON.parse, what is left to be achieved ?obj.idand you've got the array. Orobj.id.lengthfor the length of it (should be 1 here)idarray contains one item; an empty string