4

How do i access the JSON object in javascript whena JSON object is something like this.

{'':'my-first-Name'}

The Name of the property is empty and i am not able to access it.

Regards.

asked Feb 19, 2015 at 8:01
0

3 Answers 3

6

You can always access object's property by index of key. For example:

 var object = {'':'my-first-Name'};
 var value = object[''];
answered Feb 19, 2015 at 8:04
Sign up to request clarification or add additional context in comments.

Comments

3

You can access by this

var v={'':'my-first-Name'};
document.write(v['']);
answered Feb 19, 2015 at 8:03

Comments

3

var x = {'':'my-first-Name'}
alert(x['']);

answered Feb 19, 2015 at 8:03

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

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.

Ask question

Explore related questions

See similar questions with these tags.