Skip to content

Instantly share code, notes, and snippets.

@kochmaxence
Last active March 13, 2018 14:31
Show Gist options
  • Save kochmaxence/ad9280ea25b497b70a7c14da5589cc89 to your computer and use it in GitHub Desktop.
Save kochmaxence/ad9280ea25b497b70a7c14da5589cc89 to your computer and use it in GitHub Desktop.
function test(
a = '_a default_\n',
b = '_b default_\n',
c = '_c default_\n',
d = '_d default_\n',
e = '_e default_\n',
f = '_f default_\n'
) {
console.log(a, b, c, d, e, f);
}
test(
undefined, // a
null, // b
false, // c
[], // d
{}, // e
'' // f
);
/*
output:
» node test6.js
_a default_
null false [] {}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment