itskamil4u itskamil4u
  • 15-07-2021
  • Computers and Technology
contestada

Write a program to find the largest and smallest numbers in a list.

Respuesta :

tonb
tonb tonb
  • 15-07-2021

Answer:

const arr = [14, 58, 20, 77, 66, 82, 42, 67, 42, 4];

const min = Math.min(...arr);

const max = Math.max(...arr);

Explanation:

This is javascript.

Math.min takes a variable number of arguments, so you use the spread operator (...) to turn the array into a list of arguments.

Answer Link

Otras preguntas

Please hurry!! This assignment is almost due thank you!!
What is the theme of the great Gatsby in chapter 1
Hs math need help on triangle A 100 , 100 , 160 B 100 , 100 , 100 C 100 , 60 , 20 D 100 , 40 , 40
A baby who was 18 inches at birth is now 24 inches by what percentage did the babys height increase
S is a geometric sequence. a) (1x + 1), 1 and (rootx - 1) are the first three terms of S. Find the value of x. You must show all your working. b) The 5 term of
What is force? And tell it's unit
What is 246,588 rounded to the ten thousands place?
HEPL!! due in 2 hours so please help or attempt! I came up with 5 different answers and don't know which one is the actual answer!!​
Can someone help me? ​
From which group did most military, church, and government leaders come?