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

Locations near the equator _____. a. are warm in the summer and cold in the winter b. experience four distinct seasons throughout the year c. experience little
If the price of pencils went from $2 a box to $10 a box, what will happen to the demand based on change in price? the demand will go down the demand will incr
Name and critically discuss the human rights that you felt the media infringed upon shakes mashaba case?
, Determine how Giant stars differ from main sequence stars.
Calculate the discriminant and use it to determine how many real-number roots the equation has 3x^(2)-6x+4=0
Which statements are false? Money comes in different forms. Money is indivisible.
What action by the French revolutionary Assembly deprived the poor and women of full equality?
find sum of integers include between 3 and 1000 and each is divisible by 7
Jerry stevens wants to know how long it will take $1,100 to amount to $1,750 at a simple interest rate of 8 1/2%. Could you help jerry? Round time in years to n
The average fungus... A)contains chlorophyll B)in immobile C)has cell walls D)both B and C