JavaScript can be used to create an array that can potentially have all available types in it. We can use the spread operator to copy an array in JS like spreading it ( […array] ), using array.concat() , Array.from(array) or array.slice() but it will fail at run time. If you are using eslint together with TS you might have noticed the message unexpected any .

5m read timeFrom cstrnt.dev
Post cover image
Table of contents
Number 1: Readonly<T>Number 2: Any vs UnknownNumber 3: Typing Objects with Records
3 Comments

Sort: