Full-Stack Developer Question:

Tell me the output of the code below. Explain your answer?

Tweet Share WhatsApp

Answer:

var lorem = { ipsum : 1};
var output = (function(){
delete lorem.ipsum;
return lorem.ipsum;
})();

console.log(output);
The output would be undefined, because the delete operator removed the property “ipsum” from the object “lorem” before the object was returned. When you reference a deleted property, the result is undefined.

Download Full-Stack Developer PDF Read All 30 Full-Stack Developer Questions
Previous QuestionNext Question
Tell us the differences between one-way data flow and two-way data binding?Explain me the output of the code below. Explain your answer?