nas5w / javascript-tips-and-tidbits

A continuously-evolving compendium of javascript tips based on common areas of confusion or misunderstanding.
MIT License
1.2k stars 72 forks source link

Description of function push() is not correct #19

Closed Xeronic closed 4 years ago

Xeronic commented 5 years ago

"push: This is a relatively simple method that adds an item to the end of an array. It modifies the array in-place and the function itself returns the item added to the array."

The return value is not the pushed value, it's the length of the array when the value has been pushed.

nas5w commented 5 years ago

Thanks! Would you like to make the fix and do a pull request?