H
H
Heretic Man2018-11-16 21:23:13
JavaScript
Heretic Man, 2018-11-16 21:23:13

Why if the numeric value in the array contains more than 2 points, then the interpreter considers it a string?

5bef0a944cd0a556614932.png
Please explain this behavior, and how can I convert these strings to a numeric value.
The fact is that I need to iterate over the array and if there is a text value there, delete it, leaving only numbers

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Decadal, 2018-11-16
@Decadal

strings with more than one dot can only be converted to a number with data loss. ParseInt, parseFloat, look for the function that suits you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question