-
-
Save QuocCao-dev/958852e1b46b05e6a0eb561a330f7548 to your computer and use it in GitHub Desktop.
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
| function greeting(name){ | |
| if(name === undefined){ | |
| name = 'user' | |
| } | |
| return 'Hello '+ name; | |
| } | |
| console.log(greeting()) |
buymed-hoangpham
commented
Sep 24, 2022
const greeting = (name) =>
name === undefined ? 'Hello user' : `Hello ${name}`;
console.log(greeting());function greeting(name = 'user'){
return 'Hello '+ name;
}
console.log(greeting())function greeting(name = 'user'){
return 'Hello '+ name;
}
console.log(greeting())
Author
const greeting = (name = "user") => `Hello ${name}`;
console.log(greeting('Quoc'));
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment