mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
583 B
29 lines
583 B
5 years ago
|
## Mutability
|
||
|
|
||
|
### Instruction
|
||
|
|
||
|
Create a copy of the person object called clone1.
|
||
|
Create an other copy of the person object called clone2.
|
||
|
|
||
|
Create a new variable `samePerson` with the same value as `person`.
|
||
|
|
||
|
Increase by one the property age of `person`
|
||
|
and set his contry to `'FR'`.
|
||
|
|
||
|
|
||
|
## Notions
|
||
|
|
||
|
- https://nan-academy.github.io/js-training/examples/set.js
|
||
|
- https://nan-academy.github.io/js-training/examples/get.js
|
||
|
- https://nan-academy.github.io/js-training/examples/data-structures.js
|
||
|
|
||
|
|
||
|
### Code provided
|
||
|
```js
|
||
|
const person = {
|
||
|
name: 'Rick',
|
||
|
age: 77,
|
||
|
country: 'US',
|
||
|
}
|
||
|
```
|