Map
Contains
Reduce
Filter
forEach -
var test = [5, 6, 2]
var maxNumDeclarative = function(array) {
// your code here
var maxi = array[0]
array.forEach((item) => {
if (item > maxi)
maxi = item;
})
// array.forEach(function (item) {
// if (item > maxi) {
// maxi = item;
// }
// })
return maxi;
};
maxNumDeclarative(test); ```
Top comments (0)