I tried delete a variable in javascript using delete operator, but found some issue.
Can you guys please explain the below code, and why it is happening
>> var a = 5;
>> delete a
false
>>a
5
>> b=5;
>>delete b
true
>>b
ReferenceError b is not defined
why var a = 5 and b = 5 are different?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…