You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: task.md
+84-2Lines changed: 84 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,11 @@
2
2
3
3
This file contains the tasks that you need to perform to practise the concepts learned from the course. Please spend some time practising; otherwise, all the time you spend learning something will be a complete waste.
4
4
5
-
> Please Note: These tasks are for your practice. If you are stuck, go back to the videos and get the clarifications. If you are still stuck, feel free to start a conversation on [tapaScript Discord](https://discord.gg/HHwdF8r28m).
> Please Note: These tasks are for your practice. If you are stuck, go back to the videos and get the clarifications. If you are still stuck, feel free to start a conversation on [tapaScript Discord](https://discord.gg/HHwdF8r28m).
8
10
9
11
-[ ]**T-001**: Create an array of 5 elements using the Array Constructor.
10
12
-[ ]**T-002**: Create an array of 3 empty slots.
@@ -26,3 +28,83 @@ This file contains the tasks that you need to perform to practise the concepts l
26
28
-[ ]**T-018**: Can you give examples of sparse and dense arrays?
27
29
-[ ]**T-019**: Give a practical usages of the .fill() method
28
30
-[ ]**T-020**: How to convert an array to a string?
31
+
32
+
33
+
> Consider these input arrays for question **T-21** to **T-48**
34
+
35
+
-`employees array`: An array of emplyees working in a department.
-`departments array`: An array of departments where emplyees work.
53
+
54
+
```js
55
+
constdepartments= [
56
+
{ id:1, name:"HR" },
57
+
{ id:2, name:"Engineering" },
58
+
{ id:3, name:"Marketing" },
59
+
{ id:4, name:"Sales" },
60
+
];
61
+
```
62
+
63
+
-[ ]**T-021**: Can you filter employees who work in the "Engineering" department?
64
+
-[ ]**T-022**: Create a new array that combines employee names and department names in the format: "Alice (HR)".
65
+
-[ ]**T-023**: Find the highest salary among employees.
66
+
-[ ]**T-024**: Check if there is at least one employee in the "Sales" department.
67
+
-[ ]**T-025**: Write a function to filter employees earning more than 6000.
68
+
-[ ]**T-026**: Create an array of employee names only.
69
+
-[ ]**T-027**: Calculate the total salary of all employees using
70
+
-[ ]**T-028**: Is there any employee earning less than 5000?
71
+
-[ ]**T-029**: Find the first employee who earns exactly 5100.
72
+
-[ ]**T-030**: Find the last employee in the "HR" department.
73
+
-[ ]**T-031**: Find the first employee in the "Marketing" department.
74
+
-[ ]**T-032**: Check if all employees earn more than 4000.
75
+
-[ ]**T-033**: Find the last employee in the "HR" department.
76
+
-[ ]**T-034**: Verify if all employees belong to a department listed in the departments array.
77
+
-[ ]**T-035**: Log each employee's name and department name to the console.
78
+
-[ ]**T-036**: Extract all employee skill names into a single array.
79
+
-[ ]**T-037**: Increment each employee's salary by 10%
80
+
-[ ]**T-038**: Assume each employee can have multiple skills. Create an array of employee skills and flatten them. Example: [{name: "Alice", skills: ["Excel", "Management"]}, ...].
81
+
-[ ]**T-039**: Find the total salary of all employees working in the "Engineering" department.
82
+
-[ ]**T-040**: Check if there is any department where all employees earn more than 5000.
83
+
-[ ]**T-041**: Assume each employee has a projects array (e.g., { id: 1, name: "Alice", projects: ["Project A", "Project B"] }).
84
+
Find the total number of unique projects being handled across all employees.
85
+
-[ ]**T-042**: For each employee, find their department name and return an array of employee names with their department names.
86
+
-[ ]**T-043**: Get a list of names of employees earning more than 6000.
87
+
-[ ]**T-044**: Write a for-of loop to print the names of all employees from the employees array.
88
+
-[ ]**T-045**: Using a for-of loop, print the names of employees earning more than 5000.
89
+
-[ ]**T-046**: Modify the for-of loop to destructure each employee object and log their name and salary.
90
+
-[ ]**T-047**: Write a for-of loop to match employees with their departments and print the results.
91
+
-[ ]**T-048**: Use Array.prototype.entries() with a for-of loop to print the index and name of each employee.
92
+
93
+
94
+
-[ ]**T-049**: Given the array-like object below, access the second element and log it:
-[ ]**T-050**: Write a function that takes a variable number of arguments and converts the arguments object into a real array using Array.from.
99
+
-[ ]**T-051**: Write a snippet to select all div elements on a webpage (using document.querySelectorAll) and convert the resulting NodeList into an array.
100
+
-[ ]**T-052**: Merge these two arrays into a single array:
101
+
```js
102
+
constarr1= [1, 2];
103
+
constarr2= [3, 4];
104
+
```
105
+
-[ ]**T-053**: Create an array of n duplicate values using Array.from. Input: Create an array with 5 "A" values. Output: ["A", "A", "A", "A", "A"]
106
+
-[ ]**T-054**: Use Array.from to convert a string like "Hello" into an array of characters.
0 commit comments