Array 'fill' method in Javascript (Array.prototype.fill)

Published: 26 December 2017
on channel: dcode
3,110
60

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!


On this page of the site you can watch the video online Array 'fill' method in Javascript (Array.prototype.fill) with a duration of hours minute second in good quality, which was uploaded by the user dcode 26 December 2017, share the link with friends and acquaintances, this video has already been watched 3,110 times on youtube and it was liked by 60 viewers. Enjoy your viewing!