TypeScript 4.4 Cheat Sheet - SitePen

PHOTO EMBED

Sat Oct 01 2022 09:55:53 GMT+0000 (UTC)

Saved by @scott3j #typescript

type Numbers = [number, number];
type Strings = [string, string];
 
type NumbersAndStrings = [...Numbers, ...Strings]; 
// [number, number, string, string]

type NumberAndRest = [number, ...string[]];
// [number, varying number of string] 

type RestAndBoolean = [...any[], boolean]; 
// [varying number of any, boolean]
content_copyCOPY

https://www.sitepen.com/blog/typescript-cheat-sheet