Find the minimum in the array

find the minimum in the array
var arr=[5,6,2,9,-2,1]

var arr=[5,6,2,9,-2,1]
var min=arr[0];
for(var i=0;i<arr.length;i++)
{
if(min>arr[i])
{
min=arr[i];
}
}
console.log(min);

2 Likes

Correct :100: keep practicing more.