I'm a noob programmer trying to make a Javascript library, and I had this thought. In Javascript, there is a min and max function, which can use an infinite number of arguments, like Math.min(9, 8, 3, 4)
, etc. where you can use as many events in that function as you want, so you can take the minimum of an infinite amount of numbers. Is there any way you can implement something like this in a regular function, like the following below?
function test(x, y, z...) {
return Math.min(x, y, z...)
}
Again, sorry if this question is very poorly worded, but I hope someone can understand and help me on this!