function guns() {
console.log(this.had);
}
var had ="guts";
var stun = {
had : "cuts",
guns: guns
};
var murn = {
had : "mork"
};
guns();
stun.guns();
guns.call( murn );
new (guns);
I used this code in visual code studio and my browsers console, but when I run the code in these two places the result is different. In in my browsers console I get guts, cuts, mork, and undefined. In visual studios code I get undefined, cuts, mork, and undefined. Why does this happen? I'm new to javascript and programming and this is very confusing to me. I greatly appreciate any help.