Created
November 16, 2017 23:25
-
-
Save fdjones/efd841cb3f8bc62df50f674b8f970805 to your computer and use it in GitHub Desktop.
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
// class | |
class foo { | |
constructor(a, b) { | |
this.a = a; | |
this.b = b; | |
} | |
bar() { | |
return true; | |
} | |
} | |
// object literal | |
function foo(a, b) { | |
return { | |
a: a, | |
b: b, | |
bar: function () { | |
return true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment