Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find the second largest number in array javascript

const input = ['20', '120', '111', '215', '54', '78'];
const secondSort = input.sort(function (a, b) { return b - a}[1])
console.log("===> :: secondSort", secondSort);
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #find #largest #number #array #javascript
ADD COMMENT
Topic
Name
8+4 =