Skip to content

Commit ab44407

Browse files
committed
basic object
1 parent dca5d8c commit ab44407

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

04_objects/01_obj_basics.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const mySymbol = Symbol("key1")
2+
3+
4+
5+
//object literals
6+
7+
const JsUser = {
8+
name: "Soureen",
9+
email: "soureenlaha@gmail.com",
10+
age: 22,
11+
location: "Bankura",
12+
isLogged: false,
13+
[mySymbol]: "key1"
14+
15+
}
16+
//there is a datatype called symbol in javascript
17+
18+
console.log(JsUser.email);
19+
console.log(JsUser[mySymbol]);
20+
console.log(typeof mySymbol);
21+

0 commit comments

Comments
 (0)