Skip to content

Instantly share code, notes, and snippets.

@RyanCCollins
Last active September 30, 2016 03:38
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 RyanCCollins/e1358e83b1a54f5df97bd6578793f024 to your computer and use it in GitHub Desktop.
Save RyanCCollins/e1358e83b1a54f5df97bd6578793f024 to your computer and use it in GitHub Desktop.
OOLO
var Foo = {
  init: function(who) {
    this.me = who;
  },
  identify: function() {
    return "I am " + this.me;
  }
}

var Bar = Object.create(Foo);

Bar.speak = function () {
  console.log('Hello, ' + this.identify() + ".");
}

var b1 = Object.create(Bar);
b1.init('b1')
b1.speak();


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment