- 1
Why at project javascript parseInt() always return NaN
4 Answers
+ 1
Muhammad Ilham
If you try to parse a string value to number then it will always give you NaN.
For example:
parseInt('xyz') = NaN
parseInt('xy1234') = NaN
If string containing number first then it will be parse.
For example:
parseInt('123xyz') = 123
parseInt('123') = 123
0
Please link your code. Without seeing the code, we don't know what you try to do.
0
How
0
Copy the code. Go to Code section, click +, select the programming language, insert your code, save.
Come back to the thread, click +, Insert Code, sort for My Code Bits, select your code