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

Notice that Euchner uses present-tense verbs in his account. In what verb tense is historical text usually written? What effect does using present-tense verbs c
what are three of the excretory organs of the body
a baker is calculating the charge for two types of cookies. what formula tells the cost, in dollars, if chocolate chip cookies are $2.00/dozen and lemon frosted
The model below represents which multiplication sentence ?
A lame duck is a political officeholder who _____.
Can someone help me with this? And show me the work ASAP
What is letissmus dorsi?
how are proteins related to traits?
What is a community of organisms interacting with their envoirment?
Is 6 a factor of 72 please put yes or no and explain