I am trying to write a function that finds the smallest integer of an array, and was hoping that it would be as easy as dropping a Math.min() in there.
However, after looking this up and playing around with a few things, I cannot for the life of me figure out what the parameters are supposed to be.
The below was my first stab. I am aware that some methods dont require parameters (well I think I know, im a complete beginner)
/* function findSmallestInteger(arr) {
const newArr = arr.Math.min();
return newArr
}
Than this was my second.
function findSmallestInteger(func, arr) {
return arr.Math.min(arr)
}
I would like the function output to take an array and simply spit out the smallest integer in that array.
Any pointers are much appreciated