-
-
Save devsnek/7e8d4a37c774819639088648ee9d1180 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class X extends Array {} | |
class Y extends X {} | |
Is(Array, new X()); // true | |
Is(X, new X()); // true | |
Is(Object, new X()); // true | |
Is(Map, new X()); // false | |
Is(Array, new Y()); // true | |
Is(X, new Y()); // true | |
Is(Y, new Y()); // true | |
Is(Object, new Y()); // true | |
Is(Map, new Y()); // false | |
const y = new Y(); | |
Object.setPrototypeOf(y, null); | |
Is(Array, y); // true | |
Is(X, y); // true | |
Is(Y, y); // true | |
Is(Object, y); // true | |
Is(Map, y); // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment