Created
April 1, 2017 23:05
-
-
Save radovansurlak/f9dcb944c1dca7df6b4a470924dac00a to your computer and use it in GitHub Desktop.
OLOO Pattern - ES6
This file contains hidden or 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
let student = { | |
init: function (name, field, year) { | |
let instance = Object.create(this) | |
instance.name = name | |
instance.field = field | |
instance.year = year | |
return instance | |
} | |
} | |
let me = student.init('Rado','something', '1993') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment