Use:
var arr = [1, 2, 3, 4];
var largest = arr.reduce(function(x,y) {
return (x > y) ? x : y;
});
console.log(largest);
Use:
var arr = [1, 2, 3, 4];
var largest = arr.reduce(function(x,y) {
return (x > y) ? x : y;
});
console.log(largest);
For further actions, you may consider blocking this person and/or reporting abuse
Jagroop Singh -
Nik L. -
Digvijay Bhakuni -
Moein Salari -
Top comments (0)