Try to search your question here, if you can't find : Ask Any Question Now ?

How to unset a JavaScript variable?

HomeCategory: stackoverflowHow to unset a JavaScript variable?
Avatarcraig asked 3 months ago

I have a global variable in JavaScript (actually a window property, but I don’t think it matters) which was already populated by a previous script but I don’t want another script that will run later to see its value or that it was even defined.

I’ve put some_var = undefined and it works for the purpose of testing typeof some_var == "undefined" but I really do not think it’s the right way to go about it.

What do you think?

1 Answers
Best Answer
Avatarnaveen answered 3 months ago
Your Answer

8 + 7 =

Popular Tags

WP Facebook Auto Publish Powered By :