fix(curriculum): verbiage, return type, multiple arguments (#51474)

This commit is contained in:
Lasse Jørgensen
2023-09-04 12:58:01 +02:00
committed by GitHub
parent 9f4754edf0
commit e9c0bafc0e

View File

@@ -9,21 +9,21 @@ dashedName: manipulate-arrays-with-push
# --description--
An easy way to append data to the end of an array is via the `push()` function.
An easy way to append data to the end of an array is via the `push()` method.
`.push()` takes one or more <dfn>parameters</dfn> and "pushes" them onto the end of the array.
The `push()` method takes one or more <dfn>arguments</dfn> and appends them to the end of the array, in the order in which they appear. It returns the new length of the array.
Examples:
```js
const arr1 = [1, 2, 3];
arr1.push(4);
arr1.push(4, 5);
const arr2 = ["Stimpson", "J", "cat"];
arr2.push(["happy", "joy"]);
```
`arr1` now has the value `[1, 2, 3, 4]` and `arr2` has the value `["Stimpson", "J", "cat", ["happy", "joy"]]`.
`arr1` now has the value `[1, 2, 3, 4, 5]` and `arr2` has the value `["Stimpson", "J", "cat", ["happy", "joy"]]`.
# --instructions--