-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproble43.js
More file actions
24 lines (15 loc) · 750 Bytes
/
Copy pathproble43.js
File metadata and controls
24 lines (15 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Who is the tallest?
Tom and his friends are participating in the "Who is the tallest?" competition. As per the name, the person with the highest height will be the winner. Can you find who is the tallest among Tom and all of his friends?
**Input: The input line can have multiple integer numbers, xi (The height of ith friend in cm).**
**Output: Print the height of the tallest friend (cm).**
1. Sample Input-1: 157 134 188
- Sample Output-1: 188
2. Sample Input-2: 167 100 120 165 137 190
- Sample Output-2: 190 */
const theTallestIs = (peoplesHeight) => {
const tallest = Math.max(...peoplesHeight);
return tallest;
};
const heights = [167, 100, 120, 165, 137, 190];
const result = theTallestIs(heights);
console.log(result);