Javascript program to find minimum ( or maximum ) element in an array .
function getMin ( arr , n ) { return Math . min . apply ( Math , arr ) ; } function getMax ( arr , n ) { return Math . max . apply ( Math , arr ) ; }