Skip to content

In Object.defineProperty this.push() works but this.concat() does not work #5041

Answered by cjihrig
ganeshkbhat asked this question in Q&A
Discussion options

You must be logged in to vote

The second sentence of the Array.prototype.concat() page on MDN:

This method does not change the existing arrays, but instead returns a new array.

This is different from Array.prototype.push(), which modifies the array.

Side note: This is not specific to Node.js, and so Node's issue tracker is not the right place for something like this in the future.

Replies: 0 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ganeshkbhat
Comment options

Answer selected by aduh95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants