| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Errors/Missing_formal_parameter | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
SyntaxError: malformed formal parameter (Firefox)
SyntaxError
Function() . . .
. if var . .
. " " " " . " " .
var f = Function("x y", "return x + y;");
// SyntaxError (missing a comma)
var f = Function("x,", "return x;");
// SyntaxError (extraneous comma)
var f = Function(37, "alert('OK')");
// SyntaxError (numbers can't be argument names)
var f = Function("x, y", "return x + y;"); // correctly punctuated
var f = Function("x", "return x;");
// if you can, avoid using Function - this is much faster
var f = function (x) {
return x;
};
Function()This page was last modified on 2023 8 8 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |