Modern Application Development II, End Term
Which of the following statements is true about closures in JavaScript?
Which of the following statements is true about closures in JavaScript? Consider the below JavaScript program. console.log("Start"); setTimeout(function() { console.log("Inside Timeout"); }, 0); Promise.resolve().then(function() { console.log("Inside Promise"); }); console.log("End"); What will be the output of the above program? Consider the below JavaScript program. function Person(name) { this.name = name; } Person.prototype.greet = function() { console.log("Hello, " + this.name); }; const john = new Person("John"); john.greet(); delete john.greet; john.greet(); What will be the output of the above program?