🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Math.min and Math.max methods with JS - JavaScript
May 23, 2019 - I first wrote this code: let numbers = (10, 15, 59, 20); let a = Math.max(numbers); console.log(a); …which display 20 in the console. I’ve noticed that it always returns the last number of the numbers variable. Then, i wrote this (I’ve found it on W3S and modify it a bit): function myFunction() { var a = Math.min(5, 10); var b = Math.min(0, 150, 30, 20, 38); var c = Math.min(-5, 10); var d = Math.min(-5, -10); var e = Math.min(1.5, 2.5); console.log(a + " " + b + " " + ...
🌐
Adobe Support Community
community.adobe.com › home › app communities › acrobat › questions › javascript math.min calculations
Javascript Math.min calculations | Community
September 22, 2017 - It's problematic to use Math.min for that. I would create an array of all non-empty values and then use a simple function to find the lowest value in it.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Math › min
Math.min() - JavaScript | MDN
July 20, 2025 - The Math.min() static method returns the smallest of the numbers given as input parameters, or Infinity if there are no parameters.
🌐
JavaScript in Plain English
javascript.plainenglish.io › how-to-get-min-or-max-of-an-array-in-javascript-and-typescript-ed1087c080cf
How To Get Min Or Max Of An Array In JavaScript And TypeScript | by Sam C. Tomasi | JavaScript in Plain English
April 23, 2024 - export class Kata { static highAndLow(numbers: string): string { const arr: number[] = numbers.split(" ").map((c) => parseInt(c)); const max: number = Math.max(...arr); const min: number = Math.min(...arr)… ... New JavaScript and Web Development content every day.
🌐
W3Schools
w3schools.com › jsreF › jsref_min.asp
JavaScript Math min() Method
The Math.min() method returns the number with the lowest value.
🌐
LaunchCode
education.launchcode.org › intro-to-professional-web-dev › appendices › math-method-examples › max-and-min-examples.html
Math.max and Math.min Examples — Introduction to Professional Web Development in JavaScript documentation
Math.min(x, y, z, ...) This method finds and returns the smallest value from a set of numbers (x, y, z,...). To find the minimum value in an array, see below. Example · console.log(Math.min(2, 3, 100.01, 0, -5.2, 100)); Console Output · -5.2 · Unfortunately, the max and min methods will ...
🌐
Math.js
mathjs.org › docs › reference › functions › min.html
math.js | an extensive math library for JavaScript and Node.js
math.min(2, 1, 4, 3) // returns 1 math.min([2, 1, 4, 3]) // returns 1 // minimum over a specified dimension (zero-based) math.min([[2, 5], [4, 3], [1, 7]], 0) // returns [1, 3] math.min([[2, 5], [4, 3], [1, 7]], 1) // returns [2, 3, 1] math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1 math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5 ·
Find elsewhere
🌐
Educative
educative.io › answers › what-are-mathmin-and-mathmax-in-javascript
What are Math.min() and Math.max() in JavaScript?
In JavaScript, we can use: Math.min() to find the minimum of n elements. Math.max() to find the maximum of n elements.
🌐
Reintech
reintech.io › blog › tutorial-applying-math-min-method
Applying the Math.min() Method | Reintech media
January 13, 2026 - The Math.min() method is a built-in JavaScript function used to find the smallest of two or more numbers. It's a static method, meaning it's called directly on the Math object rather than on an instance of the object.
🌐
Scaler
scaler.com › home › topics › math min() javascript function
Math min() JavaScript Function - Scaler Topics
May 4, 2023 - There will be multiple instances when we have to find out the minimum of two or more numbers (any type). In Javascript programming, we can use the inbuilt Math.min() function to return the smallest number in a set of numbers (there can be
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-math-min-method
JavaScript Math min() Method - GeeksforGeeks
July 15, 2024 - The JavaScript Math min( ) Method is used to return the lowest-valued number passed in the method. The Math.min() method returns NaN if any parameter isn't a number and can't be converted into one.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Math
Math - JavaScript | MDN
This can be achieved with a combination of Math.random() and Math.floor(): ... function random(min, max) { const num = Math.floor(Math.random() * (max - min + 1)) + min; return num; } random(1, 10);
🌐
W3Schools
w3schools.com › js › js_math.asp
JavaScript Math Object
Math.min(0, 150, 30, 20, -8, -200); Try it Yourself »
🌐
Programiz
programiz.com › javascript › library › math › min
JavaScript Math min()
Become a certified JavaScript programmer. Try Programiz PRO! ... The min() method finds the minimum value among the specified values and returns it. let numbers = Math.min(12, 4, 5, 9, 0, -3); console.log(numbers); // Output: -3
🌐
DEV Community
dev.to › igadii › why-mathmin-mathmax-in-javascript-makes-complete-sense-as-it-is-164p
Why is Math.min() Greater-Than Math.max() in JavaScript - DEV Community
March 11, 2025 - Math.min() and Math.max() are static methods of the Math class that takes in a set of numbers as input arguments and returns the smallest or the largest number from the set respectively.
🌐
Vultr Docs
docs.vultr.com › javascript › standard-library › Math › min
JavaScript Math min() - Find Minimum Value | Vultr Docs
November 27, 2024 - The Math.min() function in JavaScript is a method used to determine the smallest value among the given arguments.
🌐
TutorialsPoint
tutorialspoint.com › javascript › math_min.htm
JavaScript Math.min() Method
In JavaScript, the Math.min() method accepts any number of arguments, and it returns the minimum value among those arguments.If any of the arguments is not a number, "NaN" (Not-a-Number) is returned.