Add Items to an Array with push() and unshift() 2

Tell us what’s happening:

I test this in my nodeJS and gave me correct result, but I can not pass through

Your code so far


function mixedNumbers(arr) {
  // change code below this line
 
 arr.push(7);
 arr.push("VIII");
 arr.push(9);
 arr.unshift("Three");
 arr.unshift("2");
 arr.unshift("I");
 
  // 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 (Windows NT 10.0; Win64; x64) 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

1 Like

This should be a number data type.
Does that help?

Actually, it accuses the correct answer, but the ‘test completed’ window doesn’t pop in. I’ve tested in Firefox and Chromium (Linux Mint), with correct results as well. Something is amiss.

If you have A look in my initial message you will see that I have it and I tested it on ndejs and it works fine but I can not go through the test.

Regards

You are right it helped and I also have a problem with “three” I had in with capital “Three”.

Many thanks got your help.

@maalmehdhar

kindly your code looks to be doing the right thing the wrong way that the test requires it…
REMEMBER

Array.push(item,item,item);
Array.unshift(item,item,item);

Think of your required add items to the end and beginning of the arr and modify your code…
Happy Coding and God bless you.