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
Prateek Dhuper
2354 silver badges14 bronze badges
3 Answers 3
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
Marko Gresak
8,2676 gold badges43 silver badges49 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
You can access by this
var v={'':'my-first-Name'};
document.write(v['']);
answered Feb 19, 2015 at 8:03
Anik Islam Abhi
25.4k8 gold badges61 silver badges82 bronze badges
Comments
var x = {'':'my-first-Name'}
alert(x['']);
answered Feb 19, 2015 at 8:03
realbart
4,1422 gold badges34 silver badges43 bronze badges
Comments
lang-js