Get your own customer support community
 

I have a problem finding the maximal value of an array variable

My javascript code goes like this...

function getMax(x)
{
var j = 0;
for(var i = 0 ;i < x.length ;i++)
{
if(x[j] < x[i])
j=i;
}

return (x[j]);
}
 
sad I’m despaired
Inappropriate?
1 person has this problem

User_default_medium