Chrome console clear assignment and variables

前端 未结 9 1424
野的像风
野的像风 2020-12-02 13:56

I am learning JavaScript and have been doing a lot of testing in the Chrome console. Even if I clear the console, or use any of the commands I\'ve seen in other threads (

相关标签:
9条回答
  • 2020-12-02 14:50

    If you want to remove that variable then

    delete name;
    
    0 讨论(0)
  • 2020-12-02 14:53

    There is actually an answer to this, not sure if this is new or has been here for a while but if you perform a hard refresh i.e. control + shift + r then the console values are completely removed and you can re-instantiate the same variables and functions, etc.

    0 讨论(0)
  • 2020-12-02 14:59

    I think the best way to clear the defined varible would be:

    window.location.reload();

    It would automatically remove all the declared variable at once.

    0 讨论(0)
提交回复
热议问题