Skip to content

Instantly share code, notes, and snippets.

@coltpini
Created August 1, 2016 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coltpini/1bb555d8ba626797deedde4729096ffd to your computer and use it in GitHub Desktop.
Save coltpini/1bb555d8ba626797deedde4729096ffd to your computer and use it in GitHub Desktop.
Stage 3 of interesting object pattern
let myObj = MyObj.init({option1:"billy"});
//My obj is now an instance.
myObj.myFunction();
// Hi there, billy!!
let myObj2 = MyObj.init({option1:"jimmy"});
// another instance of MyObj.
myObj2.myFunction();
// Hi there, jimmy!!
MyObj.myFunction('sam');
// Hi there, sam!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment