About 50 results
Open links in new tab
  1. Typescript Array Map Return Object - Stack Overflow

    Dec 11, 2017 · Typescript Array Map Return Object Asked 8 years, 1 month ago Modified 2 years, 4 months ago Viewed 267k times

  2. javascript - Use async await with Array.map - Stack Overflow

    You can't send an asynchronous operation to a function, like map, which expects a synchronous one, and expect it to work.

  3. How to properly type an Array.map callback in TypeScript?

    Aug 1, 2018 · I'm using React and TypeScript. When I'm iterating through an array using map(), it seems the types are not always checked. In the following example I pass a string "more" into the eachItem …

  4. dictionary - Iterating over Typescript Map - Stack Overflow

    Jun 8, 2016 · I'm trying to iterate over a typescript map but I keep getting errors and I could not find any solution yet for such a trivial problem. My code is: myMap : Map<string, boolean>; for(let key...

  5. Typescript return mapped array as const - Stack Overflow

    May 26, 2025 · I'm wondering how in Typescript I can pass an array as const as a param, map the array, then return the resulting array as const. The idea being that the mapping function preserves size of …

  6. Typescript Map function return different types after mapping

    Typescript Map function return different types after mapping Asked 3 years, 3 months ago Modified 3 years, 3 months ago Viewed 2k times

  7. How do I map a Set of Objects in typescript - Stack Overflow

    Feb 22, 2022 · 9 Set objects do not have a map() method, so it's not surprising that you're getting errors. You might be thinking of the map() method on Array objects instead. A Set is not an Array, although …

  8. TypeScript: array.map force return type? - Stack Overflow

    Aug 1, 2022 · Here's my problem I use array.map to get the resulting array. array.map 's implicit return type is any. This means that TypeScript expects my function's return type to be any, or it'll throw me …

  9. TypeScript Array: .map() is not a Function - Stack Overflow

    Mar 18, 2019 · 5 Adding <Array<Item>> won't actually turn the object into an array, its just a cast to tell typescript to think of it as an array and doesn't effect the produced javascript at all. The problem is …

  10. Typescript: Map properties from one object to another

    Aug 24, 2020 · Type inference is one of TypeScript's most important aspects. Your intuition around using map and reduce is a very natural one. Not only have we used map here, but reduce was …