11 Matching Annotations
  1. Aug 2021
    1. If there is no relationship between the value's type and the type in the type predicate, the guard would make no sense. For example, TypeScript won't allow a user-defined guard like this: function isString(value: Date): value is string { return typeof value === "string"; }
  2. Mar 2021
  3. Feb 2021
  4. Oct 2020
    1. the function you pass to the find method is called a predicate. The predicate here defines a boolean outcome based on conditions defined in the function itself, so that the find method can determine which value to find.
  5. May 2020
  6. Jan 2020