-
-
Save eoftedal/2046582 to your computer and use it in GitHub Desktop.
attempt
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
var mynamespace = mynamespace || {}; | |
(function(){ | |
var counter = { count: 0 }; | |
function incrementCounter(){ | |
counter.count++; | |
} | |
mynamespace.someobject = { | |
counter : counter, | |
incrementCounter : incrementCounter | |
}; | |
console.log("Should be 0 is.. "+mynamespace.someobject.counter.count); | |
mynamespace.someobject.incrementCounter(); | |
console.log("Wish it would be 1.. is "+mynamespace.someobject.counter.count); | |
console.log("Should also be 1... is" + counter.count); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment