The 'fill' method allows you to fill an array with a single value that you pass in. This is clearly useful if you wanted to change the value of all elements in an array at once.
With objects however, only one object gets created and each element instead has a reference to that object. Instead you'll want to use the 'map' method to achieve the same effect - which we also cover in this video.
For your reference:
https://developer.mozilla.org/en-US/d...
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Nesta página do site você pode assistir ao vídeo on-line Array 'fill' method in Javascript (Array.prototype.fill) duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário dcode 26 Dezembro 2017, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 3,110 vezes e gostou 60 espectadores. Boa visualização!