Last active
February 6, 2019 04:39
-
-
Save injune1123/f958353169a5ff9e472894ab4d351924 to your computer and use it in GitHub Desktop.
JS cheat sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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