0
lain posted
how to get dynamic property of object in JavaScript ?
var keyword={1:"jquery",2:"js",3:"nodeJs",4:"electron",5:"angular",6:"reactJs"}
console.log(keyword.1);
Uncaught SyntaxError: Unexpected number
how to get object property of by number ?
another scenario ::
for(var i=0;i< items.length;i++) {
for(var j=0;j< itemfield.length;j++) {
var field=itemfield[j].name
console.log(items[i].field);
}
}
in above code one object contain property lis to object and another its value which multidimensional array of object.
i try to get property name and than try to use it to get its value from another and its not working
so , how to get dynamic property of object in JavaScript ?