Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
triyambakam
· 3y ago · 0 comments
Do you mean pass in a type?
type NonEmptyArray<T> = [T, ...T[]];
Comments
[–]
throwaway09432
3y ago
I mean if I have a NonEmptyArray say xs, and I then xs.map(x=>2*x), will the result of this expression be a NonEmptyArray ?
[–]
triyambakam
OP
3y ago
No, unfortunately it will just be number[] as the return type.