What will be the output of the following code?

Technology CommunityCategory: JavaScriptWhat will be the output of the following code?
VietMX Staff asked 3 years ago
Problem
var x = 1;
var output = (function() {
  delete x;
  return x;
})();

console.log(output);

Above code will output 1 as output. delete operator is used to delete property from object. Here x is not an object it’s global variable of type number.