Loop through an array to find the max
Anonymous
(function () { var a = [1,4,3, 7,8,9,2,3,5,2,45,6]; var b = 0; for(var i=0; i b) { b= a[i] }} console.log('Largest element in an array is ,', b) })()
Check out your Company Bowl for anonymous work chats.