Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
notes about es6 classes for a mindmeld talk

ES6 classes

example 1

  • a constructor!
  • super
  • no commas between methods!
  • naming methods comes for free!

scrolling down

  • you can't call a class like a function. typeof Point === 'function' but Point() // TypeError
  • classes, unlike function declarations aren't hoisted!
  • static methods! For less memory use and consistency across the prototype.
  • es6 lets you programatically define keys with { [key]: true }
  • you can't create duplicate class names

General notes about babel + es6

  • no more need for use strict! you just get it for free!
  • the eslint is the only linter that supports es6 and it's still a bit buggy. We're gonna have to deal with this as they fix things.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.