Last active
November 21, 2019 21:32
-
-
Save projektorius96/40de47dd2cc43be1fee3c309f8c8f561 to your computer and use it in GitHub Desktop.
arg1, "" where "" helps out to avoid undefined attached to in console output
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
var paramArr = [" love you", " when you smile"]; | |
[arg1, arg2] = paramArr; | |
// [modified] const [arg1, arg2] = paramArr; | |
function iLoveYou (arg1, arg2) { | |
return arg1 + arg2; | |
} | |
iLoveYou(arg1, ""); | |
// output: "I love you" | |
iLoveYou("", arg2); | |
// output: "when you smile" | |
// arg1 + arg2 | |
// [modified] "I love you whene you smile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment