DEV Community

Discussion on: Advanced TypeScript Exercises - Question 9

Collapse
 
jfet97 profile image
Andrea Simone Costa

My first solution :D

type NEA<T> = [T, ...T[]]
Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
dwjohnston profile image
David Johnston

So why doesn't this work for an array of length 2?

Collapse
 
akashkava profile image
Akash Kava

TypeScript has endless magic, doesn’t stop to amaze me.