Duplicate Parameters

suggest change

A non-strict classic script allows the same parameter name twice. The binding receives the last matching argument. A "use strict" directive that is not the first statement of the script does not turn the next function into strict code.

Duplicate names are a SyntaxError in modules, in strict code, and in any function whose body starts with "use strict":

function loose(bar, bar) {
  return bar; // the last argument
}

function strict(bar, bar) { // SyntaxError
  "use strict";
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents