Interviewer And Interviewee Guide

Full-Stack Developer Interview Question:

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

Submitted by: Muhammad
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.
Submitted by: Muhammad

Read Online Full-Stack Developer Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.