Max Graey

Results 346 comments of Max Graey

I think ```new``` keyword should be exists. ```ts let arr2: int32[] = new [](2); ``` The best solution in my opinion (shortest and compatible): ```ts let arr2 = new int32[](2);...

Sure, in Typescript uses **type|void** or **type|nul**l but since **TurboScript** is a superset of **TypeScript** we can have a convenient alternative. I think declaration of optional returning type better in...

However according to this: https://github.com/Microsoft/TypeScript/issues/7426 That proposal decline in TypeScript. The main problem is to determine what is ```type?```, it is a ```type | null | undefined``` or ```type |...

Ok, I got it. So I rename topic just for default arguments

How about declare overloads as 'union types' for example: ```ts class Foo { static add(a: float32|float64|int32, b: float32|float64|int32): float64 { return a + b; } } ``` Is actually compiles...

What about extending `_` and also using for explicit casting to expected type? For example we need unsafe cast `number` to `boolean` like: ```ts function assert(value: boolean, msg?: string) {...

currently: ```ts const tup1 = [1, 2] // [number, number] const tup2: readonly [number, number] = [1, 2] // readonly [number, number] const tup3 = [1, 2] as const //...

Another variant is "exclusive or" `^`: ```ts function smallest(x: T[]): T { ... } function sum(a: T, b: T) { return a + b; } ``` TypeScript already have disjunction...