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

What figurative language is this? Maybe Forrest Gump had it right about life.
what is the basic unit of society called?
Solve the following system. Please show me how you did it.
What was Sarah G. Bagleys main achievement
If f(x)=2x^2+3x−4, and g(x)=−8x−4, what does f(x)+g(x) equal? f(x)=2x^2+5x+8 f(x)=2x^2−5x−8 f(x)=2x^2+11x−8 f(x)=2x^2+5x
What is the relationship between President Johnson’s first job and his speech? A His job as a teacher inspired him to become a great president that ends hatred
factor by grouping 3v^3-2v^2+6v-4
What fraction of an hour is 33 minuets in the simplest form
a fashion stylist wants to know if her clients are happy with her. She decides to survey a sample of her clients. What method would be best for choosing a rando
The vapor pressure of benzene is 100.0 mmHg at 26.1°C. Calculate the vapor pressure of a solution containing 26.6 g of camphor (C10H16O) dissolved in 94.0 g of