Closed
Description
opened on Jan 22, 2016
I have a piece of code with many foo[]
s that should really be [foo,foo]
-- it would be nicer if map
had a type that preserves tuples, so something like this:
var x: [number, number];
x = [1,2].map(x=>x+1);
would work, even if it's some hack with a union of tuples up to some number of elements (I think that I saw something like that around rest arguments, and I imagine that this in a close neighborhood).
I thought that this would be common, but didn't find anything about it. Feel free to dismiss if it is.
Activity