javascript get smallest value in array code example
Example 1: javascript find smallest number in an array
const arr = [14, 58, 20, 77, 66, 82, 42, 67, 42, 4]
const min = Math.min(...arr)
console.log(min)
Example 2: javascript math min array
const nums = [1, 2, 3]Math.min(...nums) // 1Math.max(...nums) // 3