Skip to content

Commit 91de4a6

Browse files
committed
Merge pull request #4 from misteroh/patch-1
Update constant.js
2 parents 678d701 + e1a20c3 commit 91de4a6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

constant.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
/**
2-
* constant is a single assignmet variable.
2+
* constant is a single assignment variable.
33
*/
44

55
function foo(){
66
const i = 1;
77

88
var bar = i; // 1
99
var i = 2; // error
10-
}
10+
}
11+
12+
function fooTwo(){
13+
const object = {
14+
nestedProperty: 1
15+
};
16+
17+
object = 2; // error
18+
object.nestedProperty = 2; // no error
19+
}

0 commit comments

Comments
 (0)