Convert to number

Report a typo

In the code below, you have a function named convertToNumber(), which receives an array of string as a parameter.

Use the map() method to convert all the items in this array into numbers and return the new array.

Sample Input 1:

1 3 5 7 9

Sample Output 1:

[ 1, 3, 5, 7, 9 ]
Write a program in JavaScript
function convertToNumber(arrayOfString) {
return ...;
}
___

Create a free account to access the full topic