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
Warning: Do not use apply() to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means new.target is undefined, and classes throw an error becaus
In this case, you can use apply to implicitly "spread" an array as a series of arguments.
In this case, you can use apply to implicitly "spread" an array as a series of arguments.
Using apply() and built-in functions
Clever usage of apply() allows you to use built-in functions for some tasks that would probably otherwise require manually looping over a collection (or using the spread syntax).
Using apply() and built-in functions
Clever usage of apply() allows you to use built-in functions for some tasks that would probably otherwise require manually looping over a collection (or using the spread syntax).
This page was last modified on Jul 10, 2025 by MDN contributors.