└── README.md
/README.md:
--------------------------------------------------------------------------------
1 | # js-problems-part2-practice-tasks
2 |
3 | ### Task -1:
4 | Find the lowest number in the array below.
5 |
6 | `const heights2 = [167, 190, 120, 165, 137];`
7 |
8 | ---
9 |
10 | ### Task -2:
11 | Find the friend with the smallest name.
12 |
13 | `const heights2 = ['rahim', 'robin', 'rafi', 'ron', 'rashed'];`
14 |
15 | ---
16 |
17 | ### Task-3:
18 | Your task is to calculate the `total budget` required to buy electronics:
19 |
20 | laptop = 35000 tk
21 | tablet = 15000 tk
22 | mobile = 20000 tk
23 |
24 | Write a JavaScript function named `calculateElectronicsBudget` that takes in the number of `laptop, tablets, and mobile` and returns the `total money required`.
25 |
26 | ---
27 | ### Task-4:
28 |
29 | You are `given an array of phone objects`, each containing information about the `model, brand, and price`. Your task is to write a JavaScript function named `findAveragePhonePrice` that takes this `array as input` and returns the `average price of phone`.
30 |
31 | **Input**
32 |
33 |
34 |
35 | const phones = [
36 | { model: "PhoneA", brand: "Iphone", price: 95000 },
37 | { model: "PhoneB", brand: "Samsung", price: 40000 },
38 | { model: "PhoneC", brand: "Oppo", price: 26000 },
39 | { model: "PhoneD", brand: "Nokia", price: 35000 },
40 | { model: "PhoneE", brand: "Iphone", price: 105000 },
41 | { model: "PhoneF", brand: "HTC", price: 48000 },
42 | ];
43 |
44 | ---
45 | ### Task -5: (Hard)
46 | For each employee their current salary is calculated by multiplying yearly increment with experience then adding the result to the starting salary. Now calculate is the total salary has to be provided by the company in a month.
47 | ```
48 | const employees = [
49 | { name: "shahin", experience: 5, starting: 20000, increment: 5000 },
50 | { name: "shihab", experience: 3, starting: 15000, increment: 7000 },
51 | { name: "shikot", experience: 9, starting: 30000, increment: 1000 },
52 | { name: "shohel", experience: 0, starting: 29000, increment: 4000 },
53 | ];
54 | ```
55 |
56 |
57 |
--------------------------------------------------------------------------------