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.
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 9Sample Output 1:
[ 1, 3, 5, 7, 9 ]Create a free account to access the full topic