- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path11_Objects.js
More file actions
Latest commit
25 lines (21 loc) · 620 Bytes
/
Copy path11_Objects.js
File metadata and controls
25 lines (21 loc) · 620 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
/*
an object is a collection of realted properties
There are (3) ways to declare objects. The following examples are are declaring a variation of the 'Object' variable
And assigning an Object to it as value.
*/
// Method-1: The 'Dot' notation
varObject1={}
Object1.name="ARK"
Object1.skinColor="Brown"
Object1.eyeColor="Brown"
// Method-2: The 'Key-value pair'
varObject2={
name: "Abdul Rehman Khan",
skinColor: "Orange",
eyeColor: "Black"
}
// Method-3: 'Bracket' Notation
varObject3={}
Object3["name"]="A.Rehman.K"
Object3["skinColor"]="Fair"
Object3["eyeColor"]="Blue"