as a haskell noob I wonder, how is this possible?
Thanks for this, I had the same question.
Abbe, please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
i understand the math.min part but can someone explain why "...args"? why not just "args"
you taught me something new .. thanks
A great use case for the spread operator.
Jajaja, no sé cómo no se me había ocurrido antes. Pero, mi código apesta jajaja.
The class is quite useless here. It doesn't add anything of value. I guess it would be possible to think of scenarios where it could be expanded to be useful. In this case, a regular function would do the job.
As for the constructor, all classes have a default constructor without parameters if you don't write one yourself. So, if you wanted to use this code you would instantiate an object, then use the function:
const finder = new SmallestIntegerFinder();
const minimum = finder.findSmallestInt([1, 2, 3, 4, 5]);
Can someone explaint the use of class here? Why use it and not just have a regular function? What purpose does it serve and how does it work? I only understand it with constructors...
lol. I feel dumb.
Math.abs(0) returns a number so adding - to a number 0 won't change it.