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
isEmpty(new Date) returns true instead of false #5131
Comments
Why do you expect |
According to the documentation, "objects are considered empty if they have no own enumerable string keyed properties." Thus IMO |
Considering the > Object.getOwnPropertyNames(new Date)
[]
> Object.getOwnPropertyNames(new Date())
[]
> Object.getOwnPropertyNames(new Date("01.01.2021"))
[] That is also counterintuitive. |
Yes. This method name has always carried with it some confusion. Instead of tweaking the method I think we should rename it. I'm open to PRs for that :) |
Thank you, I was misunderstood by the name, I think it needs to be renamed. |
_.isEmpty(new Date)
Actual returns:
true
Expected:
false
The text was updated successfully, but these errors were encountered: