Skip to content

Instantly share code, notes, and snippets.

@anurag-majumdar
Last active April 16, 2018 12:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anurag-majumdar/e93a776fd2280595d87a939b0c7e9cbe to your computer and use it in GitHub Desktop.
// 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