i am a newbie to JavaScript.I am doing this
var obj = {
a: "hello world",
b: 42
};
var b = "a";
console.log(obj[b]);
console.log(obj["b"]);
The results are
hello world
42
But how come the console.log(obj[b]);
shows hello world?
I am confused.
please tell me. thanks,.