Skip to content

Files

Latest commit

 

History

History
20 lines (12 loc) · 1.73 KB

File metadata and controls

20 lines (12 loc) · 1.73 KB

Two functions - one object easy #javascript #objects

by Pawan Kumar @jsartisan

Take the Challenge

Is it possible to create two constructor functions, A and B, such that new A() is equal to new B() when compared using the == operator?

Given the following setup:

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

let a = new A();
let b = new B();

alert(a == b); // true

Provide the implementations for A and B that satisfy the condition a == b.


Back Share your Solutions Check out Solutions