You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript should not give an error on the following case:
letdiff=newDate()-newDate();
Because the Date objects has a valueOf method that will convert the Date object to a number value during arithmetic operations. Or any expression that expects a primitive type.
TypeScript should not give an error on the following case:
Because the
Date
objects has avalueOf
method that will convert theDate
object to a number value during arithmetic operations. Or any expression that expects a primitive type.Source:
http://stackoverflow.com/questions/24764137/why-is-it-possible-to-subtract-date-objects-in-javascript-is-there-any-form-of
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf
The text was updated successfully, but these errors were encountered: