Skip to content Skip to sidebar Skip to footer

Access To Elements Of JSON Array Of Objects

My data on server is in the form of JSON array of objects. If I want to print the first object, how can I access its first object? Format of data is: [ { 'eventId': '8577',

Solution 1:

use var dataArray = JSON.parse(dataString) first, your data is a string at the moment.

Then use dataArray[0]


Post a Comment for "Access To Elements Of JSON Array Of Objects"