Good day! The question is easy, do not judge strictly) There is a numeric array of strings. How to convert it to just a numeric one?

var array = ["1", "3", "5", "7", "9", "8", "6", "4", "2"] ==> ==>[1, 3, 5, 7, 9, 8, 6, 4, 2] 
  • run through the map and convert each value via parseInt - Aleksey Shimansky

1 answer 1

It is possible, for example:

 array = array.map(num => parseInt(num));