DEV Community

Cover image for JS Test #12: Math.min()
Coderslang: Become a Software Engineer
Coderslang: Become a Software Engineer

Posted on • Originally published at learn.coderslang.com on

5 1

JS Test #12: Math.min()

js-test-12

How small is Math.min() in JavaScript?

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

The function Math.min() takes the variable number of arguments and returns the lowest number passed into it.

In our case, it’s called without any arguments which is a special case.

If Math.min() is called without any parameters, it will return Infinity which is the opposite of what you might have expected.


ANSWER: true will be printed to the screen as Infinity is greater than 0.

Top comments (0)

This post blew up on DEV in 2020:

js visualized

🚀⚙️ JavaScript Visualized: the JavaScript Engine

As JavaScript devs, we usually don't have to deal with compilers ourselves. However, it's definitely good to know the basics of the JavaScript engine and see how it handles our human-friendly JS code, and turns it into something machines understand! 🥳

Happy coding!

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay