i try to do one exercise ,this var have to be undefined
var var1 = 'hello world'
if someone can help me ?
my var have to be undefined but , i cant change anything to my var from var to ‘hello world’ its an exercise for my school
i try to do one exercise ,this var have to be undefined
var var1 = 'hello world'
if someone can help me ?
my var have to be undefined but , i cant change anything to my var from var to ‘hello world’ its an exercise for my school
2
Answers
You can undefine the variable:
var var1 = ‘hello world’;
delete var1;
You can achieve this by using ‘delete’. please be cautious when using the delete operator in real cod.
If this is NOT your answer please do let me know.