ladybird/Libraries/LibJS/Tests/instanceof-basic.js
Andreas Kling a3d92b1210 LibJS: Implement the "instanceof" operator
This operator walks the prototype chain of the RHS value and looks for
a "prototype" property with the same value as the prototype of the LHS.

This is pretty cool. :^)
2020-03-28 16:56:54 +01:00

7 lines
108 B
JavaScript

function Foo() {
this.x = 123;
}
var foo = new Foo();
if (foo instanceof Foo)
console.log("PASS");