Program to find largest element in an array | returns maximum in arr [ ] of size n ; Driver Code
function largest ( arr , n ) { arr . sort ( ) ; return arr [ n - 1 ] ; } let arr = [ 10 , 324 , 45 , 90 , 9808 ] ; let n = arr . length ; document . write ( largest ( arr , n ) ) ;