Created
September 22, 2019 15:49
-
-
Save niktariy/614e4f267a2f88869dc5d9d6dcf8e255 to your computer and use it in GitHub Desktop.
Behavior of duplicated named parameters in non-strict mode
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
function logParams (first, second, first) { | |
console.log(first, second); | |
} | |
// first => 'Hello' | |
// second => 'World' | |
// first => '!!!' | |
logParams('Hello', 'World', '!!!'); // "!!!" "World" | |
// first => { o: 3 } | |
// second => [ 1, 2, 3 ] | |
// first => undefined | |
logParams({ o: 3 }, [ 1, 2, 3 ]); // undefined [1, 2, 3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment