Tell us what’s happening:
Hello, I just wanted to know why it doesn’t work when I chain unshift & push.
I figured the solution but I just wanted to know why I couldn’t just chain the code together.
Thank you
Your code so far
function mixedNumbers(arr) {
// change code below this line
arr.unshift('I', 2, 'three').push(7, 'VIII', 9);
// change code above this line
return arr;
}
// do not change code below this line
console.log(mixedNumbers(['IV', 5, 'six']));
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures/add-items-to-an-array-with-push-and-unshift