May 09, 2021 CoffeeScript
You need to find out the maximum value contained in the array.
You can use the JavaScript implementation to use Math on the basis of list .max ():
Math.max [12, 32, 11, 67, 1, 3]...
# => 67
Another approach, in ECMAScript 5, is to use Array's reduce method, which is compatible with the old JavaScript implementation.
# ECMAScript 5
[12,32,11,67,1,3].reduce (a,b) -> Math.max a, b
# => 67
Math .max two values here and returns the larger one. O dd (...) C onverts the value of each array into an argument to the function. You can also use it to discuss with other parameters with variable numbers, such as .log.