Corrected question 245

2
closed
elthask
elthask
Posted 4 months ago

Corrected question 245 #155

const marks = [50, 20, 70, 60, 45, 30]; function findMin(arr) { return Math.min.apply(null, [...arr]); } function findMax(arr) { return Math.max.apply(null, [...arr]);

} console.log(findMin(marks)); console.log(findMax(marks));

sudheerj
sudheerj
Created 4 months ago

You don't need to use spread operator for Math.min.apply and Math.max.apply

elthask
elthask
Created 4 months ago

Maybe, but the code doesn't run as is, I just tried to go with your logic, while fixing the error. It was just a suggestion. Anyway thanks :)