JavaScript

It’s a simple tool that quickly tells you the smallest number when you line up several numbers.

Math.min

Math.min は、「いくつかの数字の中で、一番小さいものを教えてくれる道具」です。

例えば Math.min(3, 7, 1, 9) と書くと、3や7や1や9の中から「一番小さい 1」を答えてくれます。

数字をたくさん並べたとき、どれが一番小さいかをすぐに調べたいときに使えます。

また、配列を使うときには Math.min(...配列名) のように「...」をつけることで、中身を一つずつ比べることもできます。