Imeian . (2019-09-06T07:35:48.000Z)
When we need to change a value using the old value :

variable = itself + 5 // instead of
variable = variable + 5

object.child.property = itself / 5 // instead of
object.child.property = object.child.property / 5

Changing a value in nested objects is a pain, like Redux states for eg.

return {
    ...state,
    child: {
        ...state.child,
        subchild: {
            ...state.child.subchild,
            property: state.child.subchild.property + 1
        }
    }
}

would then be

return {
    ...state,
    child: {
        ...itself,
        subchild: {
            ...itself,
            property: itself + 1
        }
    }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190906/215b72a0/attachment.html>
imeian at gmail.com (2019-09-06T08:30:34.188Z)
When we need to change a value using the old value :

```js
variable = itself + 5 // instead of
variable = variable + 5
```

```js
object.child.property = itself / 5 // instead of
object.child.property = object.child.property / 5
```

Changing a value in nested objects is a pain, like Redux states for eg.

```js
return {
    ...state,
    child: {
        ...state.child,
        subchild: {
            ...state.child.subchild,
            property: state.child.subchild.property + 1
        }
    }
}
```

would then be

```js
return {
    ...state,
    child: {
        ...itself,
        subchild: {
            ...itself,
            property: itself + 1
        }
    }
}
```