Skip to content

Instantly share code, notes, and snippets.

@rauschma
Last active April 16, 2018 19:43
Show Gist options
  • Star 46 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rauschma/a4326bca3ce92ec43119 to your computer and use it in GitHub Desktop.
Save rauschma/a4326bca3ce92ec43119 to your computer and use it in GitHub Desktop.

Cheat sheet for callable entities in ES6

Value:

FD FE AF C M
Function-callable ×
Constructor-callable × ×
Prototype F.p F.p F.p SC F.p
Property prototype × ×

Whole construct:

FD FE AF C M
Hoisted ×
Inner name × ×
window property ×

Body:

FD FE AF C M
this lex
new.target lex
super.prop × × lex
super()

Abbreviations:

  • Column titles:
    • FD: Function declaration
    • FE: Function expression
    • AF: Arrow function
    • C: Class declaration and class expression (“body” entries refer to class constructor)
    • M: Method
  • Cells:
    • ✓ exists, allowed
    • × does not exist, not allowed
    • Empty cell: not applicable, not relevant
    • lex: lexical, inherited from surrounding lexical scope
    • F.p: Function.prototype
    • SC: superclass for derived classes, Function.prototype for base classes
Copy link

ghost commented Jan 23, 2016

Everything operating normally.!!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment