var workshop = {
teacher: "Kyle",
ask: function (questioin) { // not shorthand
console.log(this.teacher, questioin);
},
};
new (workshop.ask.bind(workshop)); //"no problem runs fine."
but the below cause TypeError: workshop.ask.bind(...) is not a constructor
var workshop = {
teacher: "Kyle",
ask(questioin) { // shorthand
console.log(this.teacher, questioin);
},
};
new (workshop.ask.bind(workshop)); // "this will give typeError";