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 MyThingy = (function() { | |
function doSomethingCool() { | |
//do something | |
} | |
function internalSomething() { | |
//private function because we dont return it from the bottom return | |
} | |
function anotherNiftyThing() { | |
// Note that within the scoping function, functions can | |
// call each other direct. | |
doSomethingCool(); | |
internalSomething(); | |
} | |
//The function it will return alny these funvtions all the other are private and u can't use them when u instansiate the object | |
return { | |
doSomethingCool: doSomethingCool, | |
anothrNiftyThing: anotherNiftyThing | |
}; | |
})(); |
No comments:
Post a Comment