Skip to content

Instantly share code, notes, and snippets.

@shahab570
Created December 29, 2020 13:42
Show Gist options
  • Save shahab570/68c76b12ed76a3d50b031be9e038f39f to your computer and use it in GitHub Desktop.
Save shahab570/68c76b12ed76a3d50b031be9e038f39f to your computer and use it in GitHub Desktop.
function abc(x,y) {
if (x === undefined) {
x = 100;
}
if (y === undefined) {
y = 50;
}
console.log(x,y);
}
abc(); // 100 50
abc(5) // 5 50
abc(5,10) // 5 10
abc(0,0) // 0 0
abc (null,null) // null null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment