---
# System prepended metadata

title: 'Cookie Jar 2009-GHP-RM-WEB-FT, React-Redux'

---

# Cookie Jar 2009-GHP-RM-WEB-FT, React-Redux

## Put your questions after ## below


## What's the best way to remove an item from an array with a reducer? filter or array.pop?

Array.prototype.filter is your friend! For instance, if we had an array of numbers in our state as `state.numbers`:

```javascript=
function reducer(state, action) {
  switch (action.type) {
    case REMOVE_FIVES:
      return {...state, numbers: numbers.filter(num => num !== 5)}
    default:
      return state
  }
}
```

## why don't we have to put strings in curly brackets using jsx

Because strings are "special."

¯\_(ツ)_/¯

(Honestly, that's just the way they made JSX, and there's not a deeper hidden meaning.)

