I have an array that consists of a string and number ("2",3,4). I want to multiply the same and get an output of 24.
I tried this method but getting an error of "Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'."
var stringArray = ["2",3,4];
var numberArray = [];
length = stringArray.length;
for (var i = 0; i < length; i++)
numberArray.push(parseInt(stringArray[i]));
console.log(numberArray);