React Redux: Removing From an Array

state={title: '',resultCt: 0,searchResults: {},nominations: []}
case 'REMOVE_NOMINATION':return {...state,nominations: [...state.nominations.slice(0, action.nominationIndex),...state.nominations.slice(action.nominationIndex + 1)]}




Software Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Want to move to full-stack development but not sure where to start?

Letting it be known Crodo

[Action required] Your Trial has Expired — Thu Dec 16 2021

UI Performance Enhancements

React Native — Embedded Database Options

Zero to Next.js Example with WSL2 in W11

Creating a Singleton in JavaScript with Angular

Ports are not available: listen tcp

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Lawson Hung

Lawson Hung

Software Engineer

More from Medium

React: “reduce” method

An investigative guide to React JS[DOM, Virtual DOM and JSX] Part-I

Instances of a JavaScript button (vanilla JS vs React)

How to abstract logic with React Hooks?