Tin mới
JavaScript: Scripting language
Web APIs: Programming interfaces
Structuring content with HTML module
Dynamic scripting with JavaScript module
Zero-based index at which to start filling, converted to an integer.
Using fill() to populate an empty array
This example shows how to populate an array, setting all elements to a specific value. The end parameter does not have to be specified.
This page was last modified on Jul 20, 2025 by MDN contributors.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.