Created
August 22, 2020 12:11
-
-
Save iamsaief/1d3afab8a6f7cc56dde6bddc3945ab0b 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
/* Default Parameter */ | |
function addFifty(num1, num2 = 50) { | |
return num1 + num2; | |
} | |
const result = addFifty(10, 20); | |
const result2 = addFifty(20); | |
console.log(result, result2); | |
// Output : 30 70 | |
/* Template string */ | |
function greetings(name) { | |
const greet = `Hello! Mr/Ms ${name}, Good evening`; | |
console.log(greet); | |
} | |
greetings("Jenny"); | |
// Output: Hello! Mr/Ms Jenny, Good evening |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment