Created
August 10, 2023 03:39
-
-
Save sakshstore/48234d064c798b7890f087fe7a6a3629 to your computer and use it in GitHub Desktop.
For single expression functions, you can use arrow functions with implicit return for more concise code.
This file contains hidden or 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
// Longhand | |
const multiply = (a, b) => { | |
return a * b; | |
}; | |
// Shorthand | |
const multiply = (a, b) => a * b; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment