Any

Any is available only in TypeScript. The any type is the most flexible type. It allows you to get closer to the loose nature of JavaScript when there is a need for it. Such needs could arise from third-party libraries that are not typed and if you don't know which value type may be returned from a property or method.

This type can store all the known JavaScript types:

// Stores a stringlet name: any = 'John Doe' // Stores a numberlet age: any = 24// Stores a booleanlet employed: any = true// ...even data structureslet person: any[] =['John Doe', 24, true] 

Get TypeScript 2.x for Angular Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.