T
T
Tweak_stack2015-10-31 10:23:06
JavaScript
Tweak_stack, 2015-10-31 10:23:06

How to return a property?

in JS returned JSON with the last array.
JSON -> JS returns an array of 3 objects in this format:

0: Object
    first_name: "Josh"
    __proto__: object
1: Object
    first_name: "Josh"
    __proto__: object
2: Object
    first_name: "Josh"
    __proto__: object

etc. how to return object property 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Scribblex, 2015-10-31
@Scribblex

var jsonObject = [{first_name: "Josh"}, {first_name: "Josh"}, {first_name: "Josh"}];
var item = jsonObject[0];
varname = item.first_name;
If I understand the question correctly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question