Intro to Array Methods

There are quite a few array methods. What’s important to understand is that they can mutate the current array or create a shallow copy of it. A shallow copy is peculiar because all primitives will be duplicated, but objects will have just their references copied.

[πŸŒ‘, πŸŒ‘, πŸŒ‘, πŸŒ‘].fill(πŸˆβ€β¬›) [πŸˆβ€β¬›, πŸˆβ€β¬›, πŸˆβ€β¬›, πŸˆβ€β¬›]
[πŸŒ‘, πŸŒ’, πŸŒ“, πŸŒ”].copyWithin(0, 2, 3) [πŸŒ“, πŸŒ’, πŸŒ“, πŸŒ”]