Last active
April 16, 2018 12:09
-
-
Save anurag-majumdar/e93a776fd2280595d87a939b0c7e9cbe 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
// ES6 style | |
class Animal { | |
constructor(name, weight) { | |
this.name = name; | |
this.weight = weight; | |
} | |
//... | |
} | |
// Check Type of ES6 class | |
typeof Animal // function | |
// Traditional style | |
function Animal(name, weight) { | |
this.name = name; | |
this.weight = weight; | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment