Skip to content

Commit ef0b7bb

Browse files
committed
object
1 parent 6c04e88 commit ef0b7bb

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Objects/objectexample.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
3+
/**
4+
*
5+
* What is Object
6+
*
7+
* Ans- Object is a data type in JavaScript that allows you
8+
* to store collections of data as key-value pairs.
9+
*/
10+
11+
let ball={
12+
color:"red",
13+
shape:"round",
14+
size:"large",
15+
name:"soccer ball",
16+
price:20
17+
18+
}
19+
// Accessing object properties
20+
console.log(ball);
21+
console.log(ball.color);
22+
console.log(ball.size);
23+
console.log(ball.price);
24+
console.log(ball.name);
25+

0 commit comments

Comments
 (0)