mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-06 02:26:43 +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
|
||||
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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue