MDN | MDN Curriculum | Playground | HTTP Observatory | About MDN | Advertise with us | Community | Blog | MDN Plus | MDN Discord | HTML: Markup language | Elements | Global attributes | Attributes | See all… | Responsive images | HTML cheatsheet | Date & time formats | See all… | SVG | MathML | XML | CSS: Styling language | Properties | Selectors | At-rules | Values | See all…
Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
Note: Because the default parameter is evaluated when the function is called, not when the function is defined, the validity of the await and yield operators depends on the function itself, not its surrounding function.
Passing undefined vs. other falsy values
In the second call in this example, even if the first argument is set explicitly to undefined (though not null or other falsy values), the value of the num argument is still the default.
Destructured parameter with default value assignment
You can use default value assignment with the destructuring syntax.
Nullish coalescing operator (??)
This page was last modified on Jul 8, 2025 by MDN contributors.