How to get the name of an object in an associative array (javascript) -


lets suppose have object

var clicorp14={   "id":13,   "url":"corp_longboard.html",   "logo":"img/corp/logolongboard.png",   "alt":"longboard store",   "name":"longboard", }; 

i want put text "alt" in var. don't want put "longboard store", want put text "alt". how access object?

object.keys(clicorp14); // -> ["id", "url", "logo", "alt", "name"] 

note object.keys() es5+ method, , available in ie9+ (although easy polyfill).


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -