

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get the smallest of zero or more numbers in JavaScript?
To get the smallest of zero or more number in JavaScript, use the Math.max() method. If no arguments are given, the results is -Infinity.
Syntax
The following in the syntax −
Math.min(value1, value2, ... valueN ) ;
The parameter value1, value, … value N numbers.
Example
You can try to run the following code to get the smallest of zero or more numbers −
<html> <head> <title>JavaScript Math min() Method</title> </head> <body> <script> var value = Math.min(30, 100, -50, 90); document.write("First Value : " + value ); value = Math.min(0, -1); document.write("<br />Second Value: " + value ); </script> </body> </html>
- Related Questions & Answers
- How to get the largest of zero or more numbers in JavaScript?
- How to write Python regular expression to get zero or more occurrences within the pattern?
- How to get the smallest integer greater than or equal to a number in JavaScript?
- Match any string containing zero or more p's.
- How to find the smallest number in an R data frame column excluding values zero or less?
- Smallest Common Multiple of an array of numbers in JavaScript
- How to increment one or more counters with JavaScript?
- GCD of more than two (or array) numbers in Python Program
- Get the smallest array from an array of arrays in JavaScript
- How to find the common elements between two or more arrays in JavaScript?
- How to attach one or more drop-shadows to the box with JavaScript?
- C++ Program for GCD of more than two (or array) numbers?
- Python Program for GCD of more than two (or array) numbers
- Java Program for GCD of more than two (or array) numbers
- JavaScript - Find the smallest n digit number or greater
Advertisements