| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Errors/Unnamed_function_statement | [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: (Edge) SyntaxError: [Firefox] SyntaxError: ( [Chrome]
SyntaxError
function, . , , , IIFE, .
( ) , :
function () {
return 'Hello world';
}
// SyntaxError: function statement requires a name
() :
var greet = function () {
return "Hello world";
};
, , IIFE ( ), , , . :
(function () {})();
function . :
function Greeter() {
german: function () {
return "Moin";
}
}
// SyntaxError:
, :
function Greeter() {
german: function g() {
return "Moin";
}
}
, . function.
var greeter = {
german: function () {
return "Moin";
},
};
, . .
promise.then(
function() {
console.log("success");
});
function() {
console.log("error");
}
// SyntaxError: function statement requires a name
:
promise.then(
function() {
console.log("success");
},
function() {
console.log("error");
}
);
This page was last modified on 7 . 2023 . 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 |