1

I have a data from server like this

{"hello2": "world2", "hello3": ["world3", "second_world3"], "hello1": "world1"}

And I want console.log() to get only one value : second_world3

Is there any way except using $.each?

2 Answers 2

4

var json  = {"hello2": "world2", "hello3": ["world3", "second_world3"], "hello1": "world1"}

alert(json.hello3[1]);

Sign up to request clarification or add additional context in comments.

Comments

2

The question is not really clear, does your object is always in the same format? You can use plain JavaScript for that:

var myObject = {"hello2": "world2", "hello3": ["world3", "second_world3"], "hello1": "world1"};
console.log(myObject.hello3[1]);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.