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 :: node.js vm 
Javascript :: Why my array resets itself when I leave my function 
Javascript :: js arrow function 
Javascript :: How to compare two different date formats in javascript 
Javascript :: how to use paystack with react 
Javascript :: js try without catch 
Javascript :: JavaScript try...catch...finally Statement 
Javascript :: read more css js 
Javascript :: json api demo 
Javascript :: react navbar responsive 
Javascript :: google analytics nextjs 
Javascript :: jquerey dropdown button 
Javascript :: jquery modal 
Javascript :: convert string to array js 
Javascript :: javascript json 
Javascript :: javascript destructuring 
Javascript :: toggle class jquery 
Javascript :: npm start browser 
Javascript :: pass array as argument javascript 
Javascript :: javascript array remove last 
Javascript :: module.exports with JavaScript 
Javascript :: unexpected end of json input 
Javascript :: null vs undefined 
Javascript :: useref initial value 
Javascript :: what is auth guard in angular 
Javascript :: javascript static 
Javascript :: how can i use exact in react router dom v6 
Javascript :: nodejs cluster 
Javascript :: onmousedown 
Javascript :: classlist toggle 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =