some advice you
value are two types 1. primitive 2. no primitive
- string, number, and boolean So far you’ve been working with numbers, strings, and booleans. These kinds of JavaScript values are “immutable”, meaning unchangeable or “read-only”. You can trigger a re-render to replace a value:
- object and array are reference values.
Tips:you have to change immutably
which means always give to new objects and array
3.handleChange function one
- Technically, it is possible to change the contents of the object itself. This is called a mutation: