✳flâneur — a map of the web's best reading
TypeScript: Documentation - Object Types
typescriptlang.org · 5,856 words · saved by 1 readers
How TypeScript describes the shapes of JavaScript objects.
In JavaScript, the fundamental way that we group and pass around data is through objects. In TypeScript, we represent those through object types . As we’ve seen, they can be anonymous: ts function greet ( person : { name : string ; age : number }) { return "Hello " + person . name ; } Try or they can be named by using either an interface: ts interface Person { name : string ; age : number ; } function greet ( person : Person ) { return "Hello " + person . name ; } Try or a type alias: ts type Person = { name : string ; age : number ; }; function greet ( person : Person ) { return "Hello " + pe
Explore this link on the map →related reading
- TypeScript: Documentation - TypeScript 3.7typescriptlang.org
- TypeScript: Documentation - The Basicstypescriptlang.org
- Reading 2: Basic TypeScriptweb.mit.edu
- TypeScript: Documentation - Genericstypescriptlang.org
- Typing Component Props | React TypeScript Cheatsheetreact-typescript-cheatsheet.netlify.app
- Basic TypeScriptweb.mit.edu
- Typescript utility types that you must know - DEV Communitydev.to
- TypeScript: Documentation - More on Functionstypescriptlang.org
- TypeScript: Documentation - Classestypescriptlang.org
- TypeScript: Documentation - TypeScript 3.8typescriptlang.org
- Reading 8: Defining ADTs with Interfaces, Generics, Enums, and Functionsweb.mit.edu
- TypeScript: Documentation - TypeScript for the New Programmertypescriptlang.org