Answers for "In this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number."

0

In this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number.

function highestAndLowest(numbers){
  numbers = numbers.split(" ");
  return Math.max.apply(null, numbers) + " " +  Math.min.apply(null, numbers)
}

document.write(highestAndLowest("1 2 3 4 5"))
Posted by: Guest on June-02-2021

Code answers related to "In this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number."

Browse Popular Code Answers by Language