voxel.x
into a
, voxel.y
into b
, and voxel.z
into c
, you have that freedom as well.
```js
const { x: a, y: b, z: c } = voxel; // a = 3.6, b = 7.4, c = 6.54
```
You may read it as "get the field x
and copy the value into a
," and so on.
AVG_TEMPERATURES
, and assign value with key tomorrow
to tempOfTomorrow
in line.
getTempOfTmrw(AVG_TEMPERATURES)
should be 79
testString: assert(getTempOfTmrw(AVG_TEMPERATURES) === 79);
- text: destructuring with reassignment was used
testString: getUserInput => assert(code.match(/{[\S\s]*\w+\s*:[\S\s]*\w+\s*}\s*=\s*(avgTemperatures|AVG_TEMPERATURES)/));
- text: The key tomorrow
was destructured from AVG_TEMPERATURES
testString: getUserInput => assert(code.match(/{[\S\s]*tomorrow\s*:\s*tempOfTomorrow[\S\s]*}\s*=\s*(avgTemperatures|AVG_TEMPERATURES)/));
```