[solved] "Manipulate Arrays w/ Push". Is .push a Method?

[solved] "Manipulate Arrays w/ Push". Is .push a Method?
0.0 0

#1

See this?

ourArray.push(["happy", "joy"]); 

No Big deal I get it.
But here .push has parens after it. Does that mean it’s a method? And the stuff in the parens are args for the method?


#2

The push() method adds one or more elements to the end of an array and returns the new length of the array.

var numbers = [1, 2, 3];
numbers.push(4);

console.log(numbers); // [1, 2, 3, 4]

numbers.push(5, 6, 7);

console.log(numbers); // [1, 2, 3, 4, 5, 6, 7]

Found this example here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push


#3

Yes. .push() is a method that can be used on JavaScript Arrays and in this example ["happy", "joy"] is the argument.


#4

Got it.
Tx @ArielLeslie @rafawashere