Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Which is the minimum function in JavaScript?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article is to share with you the content of finding the minimum function in JavaScript. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The function of finding the minimum value in JavaScript is the min () function of the Math object; using this method, you can return the number with the minimum value in the specified list of numbers, the syntax "Math.min (n _ 1 ~ ~ n _ 2 ~ n _ 3).

The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.

In JavaScript, if you want a minimum, you can use Math.min ().

Take a chestnut:

Console.log (Math.min); console.log (1.5)

Look at the output:

Description:

The min () method of the Math object returns the number with the lowest value of the specified number.

Grammar: Math.min (N1 to N2, n3 to NX)

Return value: the smallest value in the parameter. If there are no arguments, Infinity is returned. Returns NaN if one of the parameters is NaN or a non-numeric value that cannot be converted to a number.

Thank you for reading! This is the end of this article on "which is the minimum function in JavaScript?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report