Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

define math.min() method in javascript

// Math.mix()

// The Math.min() method is used to return the smallest of zero or more numbers. 
// The result is “-Infinity” if no arguments are passed and the result is NaN if at least one of the arguments cannot be converted to a number.
// The min() is a static method of Math, therefore, it is always used as Math.min(), rather than as a method of a Math object created.

// EXAMPLE : 1
let num = Math.min(5,8,100,50);
console.log(num);
// OUTPUT: 5

// EXAMPLE : 2
let num_2 = Math.min(-5,-8,-100,-50);
console.log(num_2);
// OUTPUT: -100

// EXAMPLE : 3
let num_3 = Math.min();
console.log(num_3);
// OUTPUT: Infinity

// EXAMPLE : 4
let num_4 = Math.min("Haseeb",3,70);
console.log(num_4);
// OUTPUT: NaN (NOT A NUMBER)
Comment

math js min

var x = 10, y = -20;
var z = Math.min(x, y); //z = y
Comment

math min js

const expirationDate = Math.min(...[accessToken?.expiresAt, idToken?.expiresAt, refreshToken?.expiresAt].filter(expiresAt => expiresAt !== undefined);
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript convert string with square brackets to array 
Javascript :: javascript date format mm/dd/yyyy 
Javascript :: remove json javascript 
Javascript :: jquery post 
Javascript :: find a word in string javascript 
Javascript :: how to return a factorial in javascript 
Javascript :: js create array with default value 
Javascript :: how to add checked in javascript 
Javascript :: reverse string with recursion 
Javascript :: return all elements of javascript array except the first item 
Javascript :: usereducer hook 
Javascript :: leaflet circle get bounds 
Javascript :: react add class to each children 
Javascript :: react native navigation change header title 
Javascript :: json stringify double quotes 
Javascript :: Using Regular Expressions (regex) to Print JavaScript Number Format with Commas 
Javascript :: duplicate elements of array multiple times 
Javascript :: axios delete with data 
Javascript :: jquery wait for function to finish 
Javascript :: hash object javascript 
Javascript :: remove special characters in javascript 
Javascript :: usecallback vs usememo 
Javascript :: how to parse json in sql server 
Javascript :: add array to array js 
Javascript :: node get package.json version 
Javascript :: how to open print dialog box on button click 
Javascript :: regex data 
Javascript :: cookie options 
Javascript :: how to make a string with unique characters js 
Javascript :: How to get the background image URL of an element using jQuery 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =