min element in array javascript code example Example: min array javascript const nums = [1, 2, 3] Math.min(...nums) // 1 Math.max(...nums) // 3