Created
August 16, 2012 23:18
-
-
Save rnavarro/3374415 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
o = { | |
tfns: ['a','b', 'c'], | |
templates: {}, | |
templates2: {}, | |
loadTemplates: function () { | |
var t = this.tfns; | |
console.log('loading templates'); | |
$.each(this.tfns, function(i,e) { | |
console.log('each'); | |
console.log(e); | |
t[e] = 'snake'; | |
}); | |
console.log('each done'); | |
console.log(t); | |
this.templates = t; | |
for (var e in this.tfns) { | |
console.log('for'); | |
console.log(e); | |
this.templates2[e] = 'snake'; | |
} | |
console.log('for done'); | |
console.log(this.templates2); | |
}, | |
get: function() { | |
console.log('getting templates'); | |
console.log(this.templates); | |
console.log(this.templates2); | |
console.log(this.templates2.a) | |
} | |
} | |
o.loadTemplates(); | |
o.get(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment