Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

removing element at index without changing the original array

const newArray = [	
  ...state.slice(0, action.index),  
  ...state.slice(action.index + 1, state.length)
];
Source by forum.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #removing #element #index #changing #original #array
ADD COMMENT
Topic
Name
5+6 =