We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
"Date arithmetic"
No response
const a = new Date(); const b = new Date(); const c = a - b;
TypeScript shows error: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.ts(2362)
No error because the operation works.
The text was updated successfully, but these errors were encountered:
+1
Sorry, something went wrong.
https://stackoverflow.com/questions/41750390/what-does-all-legal-javascript-is-legal-typescript-mean/41750391#41750391
If you want to subtract date objects - please cast them to numbers first.
Duplicate of #5710.
See also #2361 (comment)
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
π Search Terms
"Date arithmetic"
π Version & Regression Information
β― Playground Link
No response
π» Code
π Actual behavior
TypeScript shows error: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.ts(2362)
π Expected behavior
No error because the operation works.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: