In Typescript 1.5 and later, you can use for..of
as opposed to for..in
var numbers = [1, 2, 3];
for (var number of numbers) {
console.log(number);
}
More Related Contents:
- *ngFor running an infinite loop in angular2
- Element implicitly has an ‘any’ type because expression of type ‘string’ can’t be used to index
- TypeScript function overloading
- get and set in TypeScript
- How can I see the full expanded contract of a Typescript type?
- How do you emulate nominal typing in TypeScript?
- Typescript: check if a type is a union
- How do you produce a .d.ts “typings” definition file from an existing JavaScript library?
- Typescript, merge object types?
- TypeScript – extract interface members only – possible?
- How to display json object using *ngFor
- Combining generics with index type
- How to overwrite incorrect TypeScript type definition installed via @types/package
- TypeScript TS7015 error when accessing an enum using a string type parameter
- DeepReadonly Object Typescript
- How do I import other TypeScript files?
- TypeScript interface implementing doesn’t check method parameters
- TypeScript and field initializers
- Class type check in TypeScript
- Typescript: Type of a property dependent on another property within the same object
- Get function parameter names and types in TypeScript
- Typescript: Why type alias satisfies a constraint but same interface doesn’t?
- Eliminate nevers to make union possible
- TypeScript: Define a union type from an array of strings
- Get route query params
- What is the “as syntax” pointed out by tslint?
- How to update TypeScript to latest version with npm?
- What is a TypeScript Map file?
- Typescript: Spread types may only be created from object types
- Why TypeScript lets me add a string and a number? Can I prevent it?