0

Question!

How do I modify this function and push the given item onto the end of the array and return the array?? Const items = addToArray([1, 2, 3], 4); Console.log(items, ‘<— should equal [1, 2, 3, 4]’);

4th Jun 2019, 2:25 PM
Josh White
Josh White - avatar
2 Answers
0
function addToArray(arr, num) { arr.push(num); return arr } P.S. 'const' and 'console' should have lower case 'l's.
4th Jun 2019, 2:32 PM
Russ
Russ - avatar
0
Thank you Russ
4th Jun 2019, 2:45 PM
Josh White
Josh White - avatar