Last active
April 5, 2023 14:45
-
-
Save DevGW/dcb34ea0c6692489c1ab2f403b3f706e to your computer and use it in GitHub Desktop.
Javascript :: using backticks to write Javascript #js
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
// function defaultGreet(first, last) { | |
// if (last !== undefined) { | |
// return 'Hi ' + first + ' ' + last + '!'; | |
// } else { | |
// last = ' Doe!'; | |
// return 'Hi ' + first + last; | |
// } | |
// } | |
// defaultGreet('Jane'); | |
const defaultGreet = (firstName, lastName = 'Doe') => `Hi ${firstName} ${lastName}!`; | |
// much more concise |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment