└── readme.md
/readme.md:
--------------------------------------------------------------------------------
1 | ### Task-1
2 | Access the `golden rod` color value in output.
3 | ```
4 | const colors = {
5 | red: "#ff0000",
6 | green: "#00ff00",
7 | blue: "#0000ff",
8 | "golden rod": '#daa520'
9 | };
10 | ```
11 | ---
12 | ### Task-2
13 | For this object below add a property named `passenger capacity` with value 5
14 | ```js
15 | const car = {
16 | make: "Toyota",
17 | model: "Corolla",
18 | year: 2020
19 | };
20 |
21 | ```
22 | ---
23 | ### Task-3
24 | Display the physics marks as output.
25 | ```js
26 | const student = {
27 | name: "Hamim Sakep",
28 | id: 5421,
29 | physics: {
30 | subject: "HSC Physics",
31 | author: "Shahjahan Tapan",
32 | marks: 30
33 | }
34 | };
35 | ```
36 |
37 | ---
38 |
39 | ### Task-4
40 |
41 | Count the `number of properties`.
42 |
43 | **Input:**
44 |
45 | ```js
46 | let student = {
47 | name: 'Ariana Grande',
48 | age: 21,
49 | city: 'Gaibandha',
50 | isStudent: true
51 | };
52 | ```
53 | **Output:**
54 |
55 |
56 |
57 | 4
58 |
59 | ---
60 | ### Task-5 (Hard)
61 |
62 | Loop through an object and print the key-value pairs with their `types`
63 |
64 | **Input:**
65 |
66 |
67 | let myObject = {
68 |
69 | name: 'John Doe',
70 | age: 25,
71 | city: 'Example City',
72 | isStudent: true
73 |
74 | };
75 |
76 | **Output:**
77 |
78 |
79 |
80 | key: name | type: string
81 | key: age | type: number
82 | key: city | type: string
83 | key: isStudent | type: boolean
84 |
85 |
--------------------------------------------------------------------------------