mediumtypeof type queries
What does `BoxCtor` represent, and which expression below is therefore valid?
class Box {
value = 0;
static make() { return new Box(); }
}
type BoxCtor = typeof Box;Read the full question →Types, generics, narrowing. Write TS with confidence.
Difficulty mix: 5 easy, 4 medium and 1 hard. The questions are drawn from the TypeScript library at the moment you start, so sitting the test twice does not give you the same paper.
44 TypeScript topics are in scope. These are the real topic labels on the questions.
Six real TypeScript questions from the same pool, snippet included. The answer options and explanations are not shown here. Those come after you attempt them.
class Box {
value = 0;
static make() { return new Box(); }
}
type BoxCtor = typeof Box;Read the full question →const arr: number[] = [1,2,3];\nconst x = arr[0]; // with noUncheckedIndexedAccessRead the full question →type X = `${Capitalize<"foo">}Bar`;Read the full question →let x = 5;Read the full question →const f = (x: number) => x + 1;Read the full question →type X = string & number;Read the full question →Prefer to pick your own questions? Browse all TypeScript questions. See the other 10 tests.