Skip to content

Instantly share code, notes, and snippets.

@microbial
Last active May 17, 2024 02:09
Show Gist options
  • Save microbial/265626c79e6a64a34d8f to your computer and use it in GitHub Desktop.
Save microbial/265626c79e6a64a34d8f to your computer and use it in GitHub Desktop.
es6-style-js
//NON ES6 way
function actionWord () {
//Put your action here
}
//for example
//CREATE the function
function drive () {
console.log('I am driving now')
}
//Execute the function
drive()
//ES6 way
actionWord () => {
//Put your action here
}
//for example
//CREATE the function
drive () => {
console.log('I am driving now')
}
//Execute the function
drive()
//Creating a fucntion needs => {}
@blackbutterfly1
Copy link

{} around the parameter only?

@microbial
Copy link
Author

Yeah I showed you the more common way on the screen share. Just stick with that way for now. I added another file here to show how that works.

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