Last active
May 1, 2023 17:54
-
-
Save pollardld/5d11eea71f370ee216f213761cbd59a2 to your computer and use it in GitHub Desktop.
JS Arrow Function
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
/** | |
* Ways to write an arrow function with args | |
**/ | |
// 1. Way | |
const uWhat = what => 'You ' + what; | |
// 1. e.g. | |
var whatUDid = '__Did What?__'; | |
uWhat(whatUDid); | |
// 2. Way | |
const uWhat2 = (what) => 'You ' + what; | |
// 2. e.g. | |
var whatUDid2 = '__Did What Again?__'; | |
uWhat2(whatUDid2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment