Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 291 Bytes

File metadata and controls

20 lines (13 loc) · 291 Bytes

importance: 5


Strange instanceof

In the code below, why does instanceof return true? We can easily see that a is not created by B().

function A() {}
function B() {}

A.prototype = B.prototype = {};

let a = new A();

*!*
alert( a instanceof B ); // true
*/!*