Are there any substantial reasons why modifying Array.push()
to return the object pushed rather than the length of the new array might be a bad idea?
I
Just as a historical note -- There was an older version of JavaScript -- JavaScript version 1.2
-- that handled a number of array functions quite differently.
In particular to this question, Array.push
did return the item, not the length of the array.
That said, 1.2
has been not been used for decades now -- but some very old references might still refer to this behavior.
http://web.archive.org/web/20010408055419/developer.netscape.com/docs/manuals/communicator/jsguide/js1_2.htm