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 help it would be appreciated
A baby can crawl ¾ foot in ¼ minute. How far does the baby get per minute?
A circle has a radius of 11m . Find the radian measure of the central angle that intercepts an arc of length 6 m .
brianna practices the panio 30 minutes each day write an expression for the number of hours she practises in d days
Write Well How do you help your elders at home?List five chores that you do at home and 5 ways in which you help at school.​
Which is a rational number? A.sqrt(2) B. 3.1415...... C. sqrt(15) D.sqrt(25)
14. Which is the most reasonable measure for the length of a bicycle? C. 2 cm B. 2 m A. 2 mm D. 2 km
deandre downloaded 8 apps onto his tablet in 12 secs at this rate how many apps could he download in one minute
f(x) = Square root of quantity x plus seven. ; g(x) = 8x - 11 Find f(g(x)). (1 point) f(g(x)) = 2 Square root of quantity two x plus one f(g(x)) = 8 Square roo
(3x)2 – 7y2, when x = 3 and y = 2