Conversation started with this concept,
Difference between an arrow and regular function of JavaScript.
Started asking as below code execution context.
Expected answer to be precise and clear about this concept.
I hope this helps out for future preparation for Hotstar interview for front end role
What this & self was the question.
var myObject = { foo: "bar", func: function() { var self = this; console.log("1outer func: this.foo = " + this.foo); console.log("1outer func: self.foo = " + this.foo);
var baz = (() => {
debugger;
console.log("2inner func baz: this.foo = " + this.foo); // myObject
console.log("2inner func baz: self.foo = " + self.foo); // myObject
});
(function() {
debugger;
console.log("3inner func: this.foo = " + this.foo); // undefined
console.log("3inner func: self.foo = " + self.foo); // myObject
}());
return baz;
}
};
The following metrics were computed from 2 interview experiences for the Hotstar Frontend Engineer role in Bengaluru, India.
Hotstar's interview process for their Frontend Engineer roles in Bengaluru, India is extremely selective, failing the vast majority of engineers.
Candidates reported having mixed feelings for Hotstar's Frontend Engineer interview process in Bengaluru, India.