Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed7b65e

Browse files
authored
Update: string as an object example
1 parent fea32a4 commit ed7b65e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎introduction/ch1.md

+9
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ Both the primitive and reference types in JavaScript are behind the hood reconst
2424
* Note, if you see an anti-pattern comment on a code, it means its a bad practice
2525
*/
2626

27+
/**
28+
* String is an object also
29+
*/
30+
const name = 'Emmanuel Onah';
31+
32+
name.random = 'Random';
33+
34+
console.log(name.random); // 'Random'
35+
2736
/***
2837
* arrow function is an object and we can modularize it to make its content
2938
* accessible as object property or method

0 commit comments

Comments
 (0)