Skip to content

Instantly share code, notes, and snippets.

@joeybaker
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeybaker/a5b7767a4c8b14b6a13d to your computer and use it in GitHub Desktop.
Save joeybaker/a5b7767a4c8b14b6a13d to your computer and use it in GitHub Desktop.
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