Immutability in redux

Tell us what’s happening:
Describe your issue in detail here.
hi, this challenge tells about immutability in redux and here i should not re-assign value of ‘state’ ( in immutableReducer ), but i did and still passed the challenge, why?

  **Your code so far**

const ADD_TO_DO = 'ADD_TO_DO';

// A list of strings representing tasks to do:
const todos = [
'Go to the store',
'Clean the house',
'Cook dinner',
'Learn to code',
];

const immutableReducer = (state = todos, action) => {
switch(action.type) {
  case ADD_TO_DO:
    // Don't mutate state here or the tests will fail
    state = state.concat(action.todo);
    return state;
    
  default:
    return state;
}
};

const addToDo = (todo) => {
return {
  type: ADD_TO_DO,
  todo
}
}

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/96.0.4664.110 Safari/537.36 OPR/82.0.4227.50

Challenge: Never Mutate State

Link to the challenge:

Not sure about this specific one but you can use a library called immer to “mutate” state.
It comes with Redux Toolkit

It doesn’t tell you that you can’t reassign a variable & you didn’t mutate anything – that’s why you passed. The function takes an argument called state. You return a new version of that.

If you’d mutated it, like

case ADD_TODO:
  state.push(action.todo);
  return state;

then sure. But you never do that.