[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Errors/Redeclared_parameter [Back]  [Original]

SyntaxError: redeclaration of formal parameter "x" - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

SyntaxError: redeclaration of formal parameter "x"

JavaScript "redeclaration of formal parameter" let

SyntaxError: Identifier "x" has already been declared (V8-based)
SyntaxError: redeclaration of formal parameter "x" (Firefox)
SyntaxError: Cannot declare a let variable twice: 'x'. (Safari)

SyntaxError

let JavaScript let

"arg"

js
function f(arg) {
  let arg = "foo";
}

// SyntaxError: redeclaration of formal parameter "arg"

"arg" let

js
function f(arg) {
  arg = "foo";
}

function g(arg) {
  let bar = "foo";
}


Web Proxy Viewer  |  New URL  |  Original Page