max of array in JavaScript

Viewed 14399

Given an array of values [1,2,0,-5,8,3], how can I get the maximum value in JavaScript?

I know I can write a loop and keep track of the maximum value, but am looking for a more code-efficient way of doing so with the JavaScript syntax.

2 Answers
Related