| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Statements/function | [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.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..
.
Function .
function name([param,[, param,[..., param]]]) {
[statements]
}
name.
paramN, . , , .
statements, .
, , Function , . Function .
undefined. , return, , .
JavaScript . , :
hoisted(); // "foo"
function hoisted() {
console.log("foo");
}
notHoisted(); // TypeError: notHoisted
var notHoisted = function () {
console.log("bar");
};
function , , a, b c.
function calc_sales(units_a, units_b, units_c) {
return units_a * 79 + units_b * 129 + units_c * 699;
}
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-function-definitions |
This page was last modified on 29 . 2026 . 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 |