Skip to content
Advertisement

Find the min/max element of an Array containing strings in JavaScript

How can I obtain the max number of a JavaScript Array containing strings?

JavaScript

Here’s my answer but I got NaN

JavaScript

Advertisement

Answer

You could use filter and typeof to check for number only.

JavaScript

Using Math.max.apply method

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement