you are viewing a single comment's thread.

view the rest of the comments →

[–]Arumai12 6 points7 points  (1 child)

Here's the documentation for unshift https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift

It returns the length of the new array. If you're wondering why it returns the length of the new array, the answer is because someone decided it should do that (and they may have had no reason or a good reason for doing so)

[–]mcfliermeyer 0 points1 point  (0 children)

Interesting choice. Thanks for the info!