Remove an Item from an Array - please help

Tell us what’s happening:

Please help me to pass this test, I have tried several methods, and this is the one that I feel is closer to what is being asked, but still not passing ?

Your code so far


const immutableReducer = (state = [0,1,2,3,4,5], action) => {
  switch(action.type) {
    case 'REMOVE_ITEM':
      // don't mutate state here or the tests will fail
      const newState = concat(state).slice(0, action.index).concat(state.slice(action.index + 1));
      return newState
    default:
      return state;
  }
};

const removeItem = (index) => {
  return {
    type: 'REMOVE_ITEM',
    index
  }
}

const store = Redux.createStore(immutableReducer);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36.

Link to the challenge:

HINT: concat is an array method and not a stand-alone function.

Thanks for the Hint! I figured this out now