7 kyu

Basic method

Description:

Extend the Array's built-in functions by implementing .max() method. This method will return the largest number in the array. If the array contains one or more non-number elements that can't be converted into numbers (e.g., string letters), return NaN

Example:

[2,5,1,3].max() // returns 5
[1,2,3,8,4,9,7,42,99].max() // returns 99
[2,'5',1,3].max() // returns 5 ("5" can be converted to 5)
[2,5,1,'ab'].max() // returns NaN ("ab" can't be converted to a number)

Array will contain at least one item.

Arrays
Fundamentals

Stats:

CreatedAug 23, 2015
PublishedAug 23, 2015
Warriors Trained1447
Total Skips73
Total Code Submissions3266
Total Times Completed849
JavaScript Completions849
Total Stars19
% of votes with a positive feedback rating89% of 159
Total "Very Satisfied" Votes129
Total "Somewhat Satisfied" Votes26
Total "Not Satisfied" Votes4
Ad
Contributors
  • arifhp86 Avatar
  • joh_pot Avatar
  • farhanaditya Avatar
Ad