I'm trying to access a property from inside an object. When I access the property by manually entering its path, I can retrieve it, but not when doing it dynamically.
What have I missed below?
var myApp = {
cache : {},
init: function() {
myApp.cache.akey = 'A value'; // Set the cached value
myApp.get('cache', 'akey');
},
get: function(from, key ) {
console.log(myApp.from.key); // undefined
console.log(myApp.cache.akey); // A value
}
};