Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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
second_world3
Is there any way except using $.each?
$.each
var json = {"hello2": "world2", "hello3": ["world3", "second_world3"], "hello1": "world1"} alert(json.hello3[1]);
Add a comment
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]);
Required, but never shown
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.
Explore related questions
See similar questions with these tags.