profile

Piyush Mathur

Tech Q and A

Priority DM

I have an array that holds numeric value as string we want to convert and make it all num values.

example [“30”,”45”,”-45”,”90”] after conversion it will be like [30,45,-45,90]

can we write the code in react such that it is able to convert the values to num

mind that occasionally we can get values like 45f which when converted into num gives NaN, in such cases we want that value to stay as string only and not a number.

1 x Tech Q and A
$0
Total
$0
Note: Prices shown are converted to your currency & may vary slightly at the payment gateway.
FREE