About 10,000,000 results
Open links in new tab
  1. javascript - Declare an array in TypeScript - Stack Overflow

    I'm having trouble either declaring or using a boolean array in Typescript, not sure which is wrong. I get an undefined error. Am I supposed to use JavaScript syntax or declare a new Array …

  2. typescript - How can I define an array of objects? - Stack Overflow

    Feb 16, 2016 · And Typescript will enforce the type when you pass those around. If you insist on defining a new type as an array of your custom type You wanted an array of objects, (not …

  3. Create strongly typed array of arrays in TypeScript

    It may look odd, but in TypeScript, you can create typed array of arrays, using the following syntax. For example to create an array of numbers you could write the following:

  4. How do I find an array item with TypeScript? (a modern, easier way)

    Dec 14, 2017 · How can an item be found in a array using TypeScript, considering ease of use, modern best practices, and elegance via simplicity? (restating the question slightly to seek …

  5. Array<Type> VS Type[] in Typescript - Stack Overflow

    Apr 25, 2016 · function loggingIdentity<T>(arg: Array<T>): Array<T> { console.log(arg.length); return arg; } And here is a quote from some release notes: Specifically, number[] is a …

  6. How do you sort an array of objects by a given property in …

    Sep 27, 2022 · Say you have an array of objects of the following type: type Obj = { id: number, created: Date, title: string } How would you sort by a given property without tripping up over the …

  7. array.groupBy in TypeScript - Stack Overflow

    Feb 9, 2017 · array.groupBy in TypeScript Asked 8 years, 10 months ago Modified 1 year, 9 months ago Viewed 103k times

  8. Check if array is empty or includes the value, typescript

    Jul 19, 2021 · Check if array is empty or includes the value, typescript Asked 4 years, 5 months ago Modified 2 years, 2 months ago Viewed 26k times

  9. Access last element of a TypeScript array - Stack Overflow

    Mar 18, 2018 · Is there a notation to access the last element of an array in TypeScript? In Ruby I can say: array[-1]. Is there something similar?

  10. Iterate over array of objects in Typescript - Stack Overflow

    Sep 14, 2017 · 178 I need to iterate over the array of objects in angular 2 and limit the string length display for a particular key in the object.