mirror of
https://github.com/rjNemo/functional-programming-jargon
synced 2026-06-06 02:26:43 +00:00
const is not constant fix
add `Object.freeze()` to object defenition in Constant section
This commit is contained in:
parent
02b0546772
commit
4bcf39d586
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