7 kyu
Basic method
849arifhp86
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
Similar Kata:
Stats:
Created | Aug 23, 2015 |
Published | Aug 23, 2015 |
Warriors Trained | 1447 |
Total Skips | 73 |
Total Code Submissions | 3266 |
Total Times Completed | 849 |
JavaScript Completions | 849 |
Total Stars | 19 |
% of votes with a positive feedback rating | 89% of 159 |
Total "Very Satisfied" Votes | 129 |
Total "Somewhat Satisfied" Votes | 26 |
Total "Not Satisfied" Votes | 4 |