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
}
}
}
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss