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

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

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

SyntaxError: redeclaration of formal parameter "x"

SyntaxError: redeclaration of formal parameter "x" (Firefox)
SyntaxError: Identifier "x" has already been declared (Chrome)

In this article

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 f(arg) {
  let bar = "foo";
}


Web Proxy Viewer  |  New URL  |  Original Page