js convert string in array to number code example
Example 1: javascript Convert an array of strings to numbers
const toNumbers = arr => arr.map(Number);
toNumbers(['1', '2', '3','4']); // [1, 2, 3, 4]
Example 2: convert array string to number
// CONVERT ARRAY STRING TO ARRAY NUMBER
const arrStr = ["1", "3", "5", "9"];
const nuevo = arrStr.map((i) => Number(i));
console.log(nuevo);
// [1,3,5,9];
Example 3: javascript string to a decimal
<script language="JavaScript" type="text/javascript">
var a = "3.3445";
var c = parseFloat(a);
alert(c);
</script>