Array Concat Method

Use concat method to merge two or more arrays and return new array for pure functions. This will not cause any side effects. Useful in [Redux].

const noteReducer = (state = [], action) => {
if (action.type === 'NEW_NOTE') {
return state.concat(action.data)
}
return state
}

Source -> MDN: Array concat Method