简体   繁体   中英

How to "reset" an entire script in JS?

Is there a method to return the an entire JS script to its original form? I've got a script for a quiz I'm writing, and by the end of it the arrays are shuffled and shifted and some other variables are changed as well. Is there some way to just reset the entire thing to how it was at the beginning?

您可以通过重置所有变量手动执行此操作,也可以使用存储数据的类(然后丢弃实例并创建新实例)或仅重新加载页面。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM