Morgan & Morgan interview question

Please write what the 4 console logs will output below: const objectQuiz = {     foo: "bar",     func: function() {         let that = this; //         let self = there;         console.log(this.foo);          console.log(that.foo);         console.log(self.foo);         (function() {             console.log(this.foo);             console.log(that.foo);         }());     } }; objectQuiz.func();

Interview Answer

Anonymous

Oct 9, 2020

a) bar b) bar c) undefined // undeclared d) undefined e) undefined // bar