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
isLessThan(newDate(),newDate());// okisLessThan(newDate(),Date.now());// ok, Date/number comparison allowedisLessThan(12,23);// okisLessThan('A','B');// okisLessThan(12,'B');// ~~~ Argument of type 'string' is not assignable to parameter// of type 'number'.
isLessThan(newDate(),newDate());// okisLessThan(newDate(),Date.now());// ok, Date/number comparison allowedisLessThan(12,23);// okisLessThan('A','B');// okisLessThan(12,'B');// ~~~ Argument of type 'string' is not assignable to parameter// of type 'number'.isLessThan(dateOrStr,'B');// ~~~ Argument of type 'string' is not assignable to// parameter of type 'never'.
typeCelebrateIfTrue<V>=Vextendstrue ? 'Huzzah!' : never;typeParty=CelebrateIfTrue<true>;// ^? type Party = "Huzzah!"typeNoParty=CelebrateIfTrue<false>;// ^? type NoParty = nevertypeSurpriseParty=CelebrateIfTrue<boolean>;// ^? type SurpriseParty = "Huzzah!"