© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Panda Codes
Six fingers make for faster coding
Is there a reason you'd want to write a function to wrap array.push() in this manner? You've actually made a worse option as array.push will accept multiple arguments, or you can pass it an entire array with the spread operator.
array.push()
array.push
Dave Gillick
Hi Panda Codes, Many thanks for your feedback. I have updated the post to include why it's best to use the spread operator.