Generation

generate functionSun, 13 Nov 2022

find the largest value in an array them multiply it by 73 then add it into a new array

const arr = [4, 5, 6, 7, 8, 9, 4] let newArr = [] const largest = (array) => { array.forEach(num => { let largest = array[0] if (num > largest){ largest = num } newArr.push(largest * 73) }) } largest(arr)

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant