Skip to content
Advertisement

What code can I put in to clear all previous user inputs and re-run the code from the top?

I am currently writing a code that accepts user inputs. However, I intend to put in an option such that if the user made an error, they may restart the process again by typing in a specific input. And I’m hoping that the code clears all previous input from the namespace:

For example

JavaScript

I’d greatly appreciate any tips.

Advertisement

Answer

Supposedly you want the console to clear if the user decides to change its input in name

JavaScript
Advertisement