What is the difference between an JSON and Array? Why do they call JSON Objects and Array Objects.
http://wiki.appcelerator.org/display/guides/Using+TableViews+-+data.js
Is this an Array or JSON? How can i identify?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
JSON is a data format that is based on a subset of JavaScript.
A simplified version of the specification is available on the JSON homepage. The full specification is available as an IETF RFC.
Libraries exist in many different languages to convert from a string of JSON data into data structures appropriate for that language (and to go the other way). A list of some of them can be found near the bottom of the JSON homepage.
An array is a data structure common to most programming languages which contains a number of variables in a specific order. JSON has an array data type.
A JSON Object is a serialisation of a collection of key/value pairs. Most programming languages have a matching data structure, such as a hash in Perl or a (simple) object in JavaScript.
In the page you link to, there is no mention of JSON. It has a variable (
weatherData) to which is assigned a simple object (using an object literal{}) which has one key (reports) to which is assigned an array (using an array literal[]) that contains a number of objects, each of which consists of a bunch of key/value pairs where the values are all strings.If you were to remove the first line, and the semi-colon at the end, then the example would be a JSON data structure representing the same information. This is because, as I said earlier, JSON is based on a subset of JavaScript and that part of the example conforms to the subset.