GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Modul 6 von 10 · Medien

Find biggest and smallest number in an array of strings

Kostas Diakogiannis

Find biggest and smallest number in an array of strings

M-2 Find the biggest Number in an Array of Strings

An error has occurred and you have found yourself with data of 10 students result tests that are of string data type.

So the results you have is a list of : ['63', '55.5', '72', '77',  '35.5', '81', '95', '29.5', '44.5',  '80']

Find the biggest and the smallest result in this list and print the margin between them by printing the absolute value of the difference between them. 

Hint; Find a way to to convert each string into a number, or float.

Check again parseFloat and parseInt functions to help yourself.

Hint: Use the Math.max and Math.min methods and pass the spread version of the array as an argument.

Either way, round the floated numbers into the biggest nearest integer. You may have learned some functions in the previous lectures  that could be helpful. 

Anleitung

Um im Kurs weiterzukommen, sende einen Versuch dieses Quiz ab. Du kannst ihn nach der letzten Frage absenden.

Zum gewählten Modul

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck