-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03_object.js
More file actions
37 lines (28 loc) · 789 Bytes
/
03_object.js
File metadata and controls
37 lines (28 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const mySym=Symbol("key1")
const JsUser={
name:"basak",
age:20,
location:"bhubanswer",
email:"basak@gmail.com",
isLoggedIn:false,
lastLoginDays:["mondays","surdays"],
// mySym:"mykey1" string
// for symbol type we have to use [] eg:-
[mySym]:"mykey1"
}
JsUser.email="pramanik@2023";
// console.log(JsUser["name"]);
// console.log(JsUser.mySym);
// console.log(JsUser[mySym]);
// console.log(JsUser["email"]);
// Object.freeze(JsUser);
// console.log(JsUser);
JsUser.greeting=function(){
console.log("hello js boys..")
}
console.log(JsUser.greeting())
JsUser.greetingTwo=function(){
console.log(`hello js boys.. ${this.isLoggedIn}`)
}
console.log(JsUser.greeting())
console.log(JsUser.greetingTwo())