Skip to content

Commit 4bcf39d

Browse files
author
Artem Riasnianskyi
authored
const is not constant fix
add `Object.freeze()` to object defenition in Constant section
1 parent 02b0546 commit 4bcf39d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ A variable that cannot be reassigned once defined.
313313

314314
```js
315315
const five = 5
316-
const john = {name: 'John', age: 30}
316+
const john = Object.freeze({name: 'John', age: 30})
317317
```
318318

319319
Constants are [referentially transparent](#referential-transparency). That is, they can be replaced with the values that they represent without affecting the result.

0 commit comments

Comments
 (0)