Imagine this object:
var obj = {
one: {
two:{
three: "whatever"
}
}
}
If I want to access "whatever" I simply do:
console.log( obj.one.two.three ) --> "whatever"
And I can even use a variable like:
var one = "one"
console.log( obj[one].two.three ) --> "whatever"
But why doesn't this work ?
var onetwo = "one.two"
console.log( obj[onetwo].three ) --> undefined