en.javascript.info/1-js/04-object-basics/06-constructor-new/1-two-functions-one-object/task.md
Ilya Kantor 79f3775034 minor
2017-03-30 13:28:35 +03:00

299 B
Raw Permalink Blame History

importance: 2


Two functions one object

Is it possible to create functions A and B such as new A()==new B()?

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

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

alert( a == b ); // true

If it is, then provide an example of their code.