⛔duplicate parameter not allowed in strict mode❗️
in "strict mode", duplicate parameters not allowed❗️
Last updated
Was this helpful?
in "strict mode", duplicate parameters not allowed❗️
Last updated
Was this helpful?
Was this helpful?
JS ⟩ error ⟩ SyntaxError ⟩ duplicate parameter name
⛔ SyntaxError: Duplicate parameter name not allowed in this context
replit:early errors
no errors in sloppy mode
console.log("Howdy"); // Howdy
sayHi("Hello", "Hi"); // Hi
function sayHi(x, x) { // duplicate parameters
console.log(x);
⭐️ not allowed in .
console.log("Howdy"); // ⭐️ never runs❗
// ⛔ SyntaxError:
// Duplicate parameter name not allowed in this context
// ↓
function sayHi(x, x) { // ⭐️ compile-time error
"use strict"; // ⭐️ strict mode
console.log(x);
}