The ES5 transpiled output from the Typescript compiler for the extends keyword isn't consistent with the current standard behavior of ES6 Javascript, and also isn't consistent with the way Typescript checks the types at compile-time.
Code
class List extends Array { }
alert(new List instanceof List);
Try it on the playground where the code is transpiled to ES5 by default.
Expected behavior:
An alert showing true.
Actual behavior:
An alert showing false.
The ES5 transpiled output from the Typescript compiler for the
extendskeyword isn't consistent with the current standard behavior of ES6 Javascript, and also isn't consistent with the way Typescript checks the types at compile-time.Code
Try it on the playground where the code is transpiled to ES5 by default.
Expected behavior:
An alert showing
true.Actual behavior:
An alert showing
false.