Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js return the highest and lowest number

console.log(Math.max(1, 3, 2));
// expected output: 3

console.log(Math.max(-1, -3, -2));
// expected output: -1

const array1 = [1, 3, 2];

console.log(Math.max(...array1));
// expected output: 3
Comment

highest and lowest javascript

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

Javascript highest to lowest

Arrays.sort(array, Collections.reverseOrder());
Comment

PREVIOUS NEXT
Code Example
Javascript :: cors axios 
Javascript :: this.setstate prevstate 
Javascript :: js add to array 
Javascript :: mui react outlined input helperText 
Javascript :: nodejs add element to array 
Javascript :: elapsed time function() {math javascript 
Javascript :: How to Check if a Substring is in a String in JavaScript Using the includes() Method 
Javascript :: scroll out js threshold 
Javascript :: how to set button width in javascript 
Javascript :: json to string 
Javascript :: wait for loop to finish javascript 
Javascript :: detect form input changes javascript 
Javascript :: javascript string repeat 
Javascript :: smtp js 
Javascript :: trim string in javascript 
Javascript :: json vs xml 
Javascript :: Uncaught (in promise) Error: Redirected when going from "/login" to "/" via a navigation guard. 
Javascript :: nestjs swagger 
Javascript :: postman environment variables 
Javascript :: how to get the value of textarea in react 
Javascript :: js array .filter 
Javascript :: encode password javascript 
Javascript :: js jwt decode 
Javascript :: swap scroll right in react native 
Javascript :: Javascript number Count up 
Javascript :: vue implode array 
Javascript :: fingerprint js 
Javascript :: super method in js 
Javascript :: pass setstate to child 
Javascript :: how to run node js with proxy 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =