Strictly speaking, the first x not a variable, but a property of a global object. window.x = "Hello" typically have window (therefore x = "Hello" equals window.x = "Hello" ). You cannot use delete to delete variables, but you can use it to delete the properties of an object and what it does in the first case.
source share