Skip to content

Instantly share code, notes, and snippets.

@haoch
Created June 7, 2013 06:15
Show Gist options
  • Save haoch/5727357 to your computer and use it in GitHub Desktop.
Save haoch/5727357 to your computer and use it in GitHub Desktop.
refer to arborjs.org: javascript object closure
(function(){
// TODO evironment logic
OBJECT_NAME=function(){
var that = {
init:function(){
that.func_name()
return that
},
func_name:function(){
// do func1
}
}
return that.init()
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment