I have this code that seems like it would work. I am using the reduce method on an array of numbers as slips of paper drawn from a box. Reduce should output the minimum value. The accumulator is the number to compare the current value against. I believe 100 would be compared against the first number in the array, the result of finding of the minimum would compare to the second value in the array and so on.
Running it on the repl environment yields “Unexpected token ‘=>’.” What is jamming it?
let numberDrawn = [56, 45, 52, 39]; const findMin = numberDrawn.reduce((accumulator, slip) => Math.min(accumulator, slip), 100 );