Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There may be a bug here #5853

Closed
12914hh opened this issue Apr 24, 2024 · 2 comments
Closed

There may be a bug here #5853

12914hh opened this issue Apr 24, 2024 · 2 comments

Comments

@12914hh
Copy link

12914hh commented Apr 24, 2024

Hi,
Thank you for providing such a useful tool.
But here I found a bug !
When I use the isNaN method in lodash,
I found that if I execute console.log(_.isNaN('a')), theoretically 'a' is a string, so the result should be true.
But now I'm getting false.
This is also the case with the RunKit test under the official documentation.
image
Thanks again

@nikwen
Copy link

nikwen commented Apr 24, 2024

NaN is a special constant in JavaScript: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN

_.isNaN() only checks if your value is that constant.

See the second line in the documentation for pointers to functions that might help you accomplish what you're trying to accomplish:

image

@12914hh
Copy link
Author

12914hh commented Apr 28, 2024

Thank you for your response, I indeed didn't understand the difference between isNaN and Number.isNaN. Thank you. 👍

@12914hh 12914hh closed this as completed Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants