Array.push
Easy
12
81.8% Acceptance
In this coding challenge, you will be implementing a function called append(array, value)
that takes two arguments: an array
and a value
. The function should append the value to the end of the array.
Example test cases
append([1, 2, 3], 4); // Output: [1, 2, 3, 4] append(['foo', 'bar'], 'baz'); // Output: ['foo', 'bar', 'baz']
Hints
- You can use the built-in method
.push()
directly on the input array.