Comments

Bhargav4 months ago

const solve = (intArray) => {
  return intArray.slice(1);
};

violet withdrawal6 months ago

const solve = (intArray) => { intArray.shift() return intArray; };

payment Fish backing up8 months ago

I'm a little embarrassed that it took me as long as it did.

const solve = (intArray) => { intArray.shift() return(intArray) };

I kept trying to do .shift inside the return which was only showing me what was being shifted off the array, not what remained.

SAS2 years ago

const solve = (intArray) => { return intArray.slice(1); };

Kara Diaby2 years ago

const solve = (intArray) => { return intArray.splice(1) }; ``

Ameliorated Tugrik8 months ago

Did in one line - Well done! Sometimes forget about an obvious solution! :)

Stanislav2 years ago

Looks clear with array destruction. const solve = (array) => { const [first, ...rest] = array; return rest; }

Savings Account Ergonomic2 years ago

const solve = (intArray) => { return intArray.filter((item,index)=>index!=0);};

jon snow2 years ago

const solve = (intArray) => { return intArray.slice(-(intArray.length)+1) };

Juan Luis Rojas León2 years ago

// shift removes the first element from an array
const solve = (intArray) => {
  intArray.shift();
  return intArray
};