Get to know MDN better
Esta página ha sido traducida del inglés por la comunidad. Aprende más y únete a la comunidad de MDN Web Docs.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since septiembre de 2015.
El método fill() cambia todos los elementos en un arreglo por un valor estático, desde el índice start (por defecto 0) hasta el índice end (por defecto array.length). Devuelve el arreglo modificado.
Valor con el que se va a rellenar el arreglo. (Nótese que todos los elementos en el arreglo tendrán este mismo valor).
start OpcionalÍndice inicial, por defecto 0.
end OpcionalÍndice final, por defecto this.length.
El arreglo modificado, rellenado con valor.
| ECMAScript® 2027 Language Specification # sec-array.prototype.fill |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 11 feb 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.