Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

find max between 2 numbers javascript

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

PREVIOUS NEXT
Code Example
Javascript :: Valid Time javascript 
Javascript :: aabb javascript 
Javascript :: pagecontrol 
Javascript :: javascript validate number only 
Javascript :: create react native app 
Javascript :: javascript sort in array of objects 
Javascript :: express check if object is empty 
Javascript :: how to set form control value in angular 
Javascript :: Copy document DOM without reference 
Javascript :: stop propagation event 
Javascript :: push tr in tbody using jquery 
Javascript :: parse json express 
Javascript :: how to check nan in jquery 
Javascript :: js how to get selectpicker value 
Javascript :: js id style backgroundColor change 
Javascript :: js create element 
Javascript :: javascript convert number from thousands to k and millions to m 
Javascript :: jquery count elements 
Javascript :: how to create a screen recorder using javascript only 
Javascript :: javascript check if two date are ugual 
Javascript :: javascript get date of last monday 
Javascript :: capitalize first letter javascript 
Javascript :: javascript get last character in string 
Javascript :: check if a string contains another string js 
Javascript :: has decimal javascript 
Javascript :: text to Speech in javascript code 
Javascript :: html loop through array 
Javascript :: jquery serialize form data and submit 
Javascript :: convert json to base64 javascript 
Javascript :: yarn react select 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =