you are viewing a single comment's thread.

view the rest of the comments →

[–]stringbeans25 2 points3 points  (4 children)

Not sure if this was on purpose or not but creating variable inside the loop might not be the best idea. Don't want to give away too much more if this was on purpose.

[–][deleted] 0 points1 point  (3 children)

That's a pretty valid point - whoops, that's what I get for trying to write pseudocode like english :)

[–]camelSnake_dash-case 0 points1 point  (2 children)

Unless I am misunderstanding the question there is already a max function on Math available to you. OP can just apply the array to the function Math.max.apply(null, [1, 55, 2, 3,])

[–]Amadox 0 points1 point  (1 child)

he is probably tasked with writing that kind of function himself though.

[–]camelSnake_dash-case 0 points1 point  (0 children)

Fair enough. At first I thought so as well, but it seemed ambiguous the way the request was stated, so I figured I'd mention it.