RecipesChapter 4: Generics

Creating Related Function Arguments

Recipe 4.2 from The TypeScript Cookbook

for (const entry of de_and_fr) {
  const result = await entry;
  if (result[0] === "en") {
    //  This condition will always return 'false' since the types
    //. '"de" | "fr"' and '"en"' have no overlap.(2367)
  }
}
Open in TypeScript Playground →