Skip to content

Instantly share code, notes, and snippets.

@injune1123
Last active February 6, 2019 04:39
Show Gist options
  • Save injune1123/f958353169a5ff9e472894ab4d351924 to your computer and use it in GitHub Desktop.
Save injune1123/f958353169a5ff9e472894ab4d351924 to your computer and use it in GitHub Desktop.
JS cheat sheet
//JS classes
classes are syntax sugars
classes get passed down
classes are not hoisted
two ways to define classes: class declarations and experssions
//straight functions vs classes
functions: hoisted, can be overwritten
classes: not hoisted, can be extended but not overwritten
classes are more like blueprints, which can have methods
classes example: react class component, stateful component
Function example: react functional component, stateless component
funciton hositing example:
\\hi();
\\
\\function hi(){
\\ return console.log("hello ")
\\}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment