Array.prototype.push () The push () method adds one or more elements to the end of an array and returns the new length of the array. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull.
Using push() Method: The push() method is used with spread operator to pushes the elements of arrays into the existing array. It is especially helpful when we need to append a value to an existing array and need not return a new array
array_push() treats array as a stack, and pushes the passed variables onto the end of array.The length of array increases by the number of variables pushed. Has the same effect as
PHP array_push() Function - W3School