❗deplicate parameters
🚧 施工中
function g(x, y, x, y) {
// ^
// ⛔ SyntaxError:
// Duplicate parameter name not allowed in this context
// (note: this is a compile-time error)
'use strict'; // ⭐️ strict mode
return [x, y];
}// function with duplicate parameters
function f(x, y, x, y) {
return [x, y];
}
// x = 3
// ⭡ ↱ y = undefined
f(1, 2, 3 ) // [ 3, undefined ]Last updated