Last active
January 16, 2017 15:14
-
-
Save jkvim/3cab345e8a6a5674378b26ea0abf0615 to your computer and use it in GitHub Desktop.
Duplicate Function Signature and Variable in JavaScript
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
// SyntaxError: foo has alreay been declared | |
const foo = (a, b) => { | |
console.log(a, b); | |
}; | |
const foo = (a) => { | |
console.log(a); | |
}; | |
foo(10, 100); | |
foo(200); | |
// No Error Throw, second one overwrite first one | |
// output: 10 | |
function bar(a, b) { | |
console.log(a, b); | |
} | |
function bar(a) { | |
console.log(a); | |
} | |
bar(10, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment