The clear() command and the Clear button just clear the screen, but any constants and variables remain, causing problems when trying to do simple tests. Do I need to restart the application every time?
Asked
Active
Viewed 443 times
-1
-
`but any constants and variables remain` what does this mean? The console doesn't make variables, which is why I am confused? – jdmdevdotnet Jan 19 '17 at 22:39
-
@AlGoreRhythm He probably wants to wipe variables that were defined in console. Like when you type: `var a = 10`, then a lives in global scope. – Tomasz Kasperek Jan 19 '17 at 22:40
-
And yes, I think you need to restart your app. @NickNearPhila – Tomasz Kasperek Jan 19 '17 at 22:42
-
http://stackoverflow.com/questions/34270829/chrome-console-clear-assignment-and-variables – Paul Fitzgerald Jan 19 '17 at 23:57
1 Answers
0
You cannot "clear" the variables set in console. They do represent current state of your application, so yes, you need to restart the application to reset this state.
You will need to write a procedure that puts variables in their original state. Or use local variables that perish once a procedure is over.

Tomáš Zato
- 50,171
- 52
- 268
- 778