162
rated 0 times
[
169]
[
7]
/ answers: 1 / hits: 132672
/ 13 Years ago, wed, august 3, 2011, 12:00:00
How to access an object using a variable as key. Here is my code sample:
var o = {k1: 111, k2: 222};
alert(o.k1); //working fine
var key = k+1; alert(key); // k1
alert(o.key); //not working
More From » javascript