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.
|
|
|
## Mutability
|
|
|
|
|
|
|
|
### Instructions
|
|
|
|
|
|
|
|
Create three copies of the `person` object named `clone1`, `clone2` and `samePerson`.
|
|
|
|
|
|
|
|
Increase the `age` of `person` by one, and set its `country` to `'FR'`.
|
|
|
|
|
|
|
|
You must find a way to keep the original values of `clone1` and `clone2`. The values of `samePerson` should change when `person` is changed.
|
|
|
|
|
|
|
|
### Notions
|
|
|
|
|
|
|
|
- [Set](https://nan-academy.github.io/js-training/examples/set.js)
|
|
|
|
- [Get](https://nan-academy.github.io/js-training/examples/get.js)
|
|
|
|
- [Data Structures](https://nan-academy.github.io/js-training/examples/data-structures.js)
|
|
|
|
|
|
|
|
### Code provided
|
|
|
|
|
|
|
|
> The provided code will be added to your solution, and does not need to be submitted.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const person = {
|
|
|
|
name: 'Rick',
|
|
|
|
age: 77,
|
|
|
|
country: 'US',
|
|
|
|
}
|
|
|
|
```
|