I am very new to JS and am playing around trying to output this verify function I came across below.
In my limited thinking I thought that the result would be false and I would be able to write that using document.write(), however it just writes [object Object] refer to https://jsfiddle.net/zyac0etj/
Hoping someone can explain/answer this for me..
function MyData(foo, bar) {
this.foo = foo;
this.bar = bar;
this.verify = function () {
return this.foo === this.bar;
};
}
\\my addendum
var test = new MyData("myfoo","mybar");
document.write(test);