3 ms·
Yes - even Typescript, when arrays are given types, doesn't fix it even though it could be done easily. var x : number[] // should compile: x.sort(function(a,
by lotsoflumens 11y ago
Yes - even Typescript, when arrays are given types, doesn't fix it even though it could be done easily.
var x : number[] // should compile: x.sort(function(a,b) { return a - b; })
var y : string[] // should compile: y.sort()
The reason that this isn't done is due to a misplaced ideology about "typescript is just javascript" - or some similar nonsense.
The bigger problem here is that we are using tools that are designed by a committee, and we have almost no hope of getting this fixed.