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

The following graph shows the results of a study evaluating the number of schools teaching different sex-education topics. A graph titled Sex Education in Schoo
Which belief was supported by Martin Luther? A. Giving a tithe to the church leads to the forgiveness of sin. B. Part of being Protestant means believing in p
2. Which of the following is NOT a necessary input for the process of photosynthesis? A. CO2 (carbon dioxide) B. Sunlight C. H20 (water) D. O2 (oxygen)
When a sample of liquid is heated, its thermal energy _______.
How do you translate "Is Diana coming?" -- using the progressive 'ing' in Spanish?
List examples of physical weathering
For whom was this battle a victory? Fort Crown Point the Americans the British
Production Budget Pasadena Candle Inc. projected sales of 72,000 candles for January. The estimated January 1 inventory is 3,600 units, and the desired January
According to this passage, why was there a sudden need for more housing in cities? Wealthy residents needed a place to stay. Businesses were taking up all of th
helppp me please i’m going to fail