mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-11 04:56:40 +00:00
Merge pull request #131 from asci/patch-1
fix: const can't guarantee object immutability
This commit is contained in:
commit
ffb13cf93f
1 changed files with 1 additions and 1 deletions
|
|
@ -313,7 +313,7 @@ A variable that cannot be reassigned once defined.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const five = 5
|
const five = 5
|
||||||
const john = {name: 'John', age: 30}
|
const john = Object.freeze({name: 'John', age: 30})
|
||||||
```
|
```
|
||||||
|
|
||||||
Constants are [referentially transparent](#referential-transparency). That is, they can be replaced with the values that they represent without affecting the result.
|
Constants are [referentially transparent](#referential-transparency). That is, they can be replaced with the values that they represent without affecting the result.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue