[go: up one dir, main page]

0% found this document useful (0 votes)
12 views1 page

Array of Objects

The document contains a JavaScript array of employee objects with details such as name, salary, company, age, and gender. It includes a list of questions that can be answered using the array, focusing on employee information, salary calculations, and sorting. The questions cover various operations like filtering, grouping, and modifying the employee data.

Uploaded by

Shamim Alam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Array of Objects

The document contains a JavaScript array of employee objects with details such as name, salary, company, age, and gender. It includes a list of questions that can be answered using the array, focusing on employee information, salary calculations, and sorting. The questions cover various operations like filtering, grouping, and modifying the employee data.

Uploaded by

Shamim Alam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

<!

DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>

<body>

</body>

</html>
<script>
let input = [
{ name: "Alice", salary: 50000, company: "Tech Corp", age: 28,
gender: "male" },
{ name: "Bob", salary: 60000, company: "Innovate Ltd", age: 34,
gender: "male" },
{ name: "Charlie", salary: 70000, company: "BuildWorks", age: 29,
gender: "female" },
{ name: "EDiana", salary: 75000, company: "Tech Corp", age: 40,
gender: "female" }
];

Questions on Array of Objects (JavaScript)


1. Print the names of all employees.
2. Print all employees who work in "Tech Corp".
3. Find the employee with the highest salary.
4. Find the employee with the lowest salary.
5. Calculate the total salary of all employees.
6. Calculate the average salary of all employees.
7. Print the names of employees whose age is above 30.
8. Count how many male and female employees are there.
9. Sort employees by salary in ascending order.
10. Sort employees by age in descending order.
11. Print only names and companies of all employees.
12. Check if there is any employee working in "Google".
13. Find the employee named "Charlie" and print details.
14. Print names of employees whose salary is greater than 60000.
15. Increase salary by 10% for employees working in "Tech Corp".
16. Create a list of only employee names in a new array.
17. Remove the employee named "Bob" from the array.
18. Group employees by company name.
19. Find the youngest employee.
20. Find the oldest employee.

</script>

You might also like