A way to forget a variable in Node.js REPL? #56752
Labels
duplicate
Issues and PRs that are duplicates of other issues or PRs.
feature request
Issues that request new features to be added to Node.js.
What is the problem this feature will solve?
It's just a tiny improvement for the REPL.
Take the following sample of REPL usage when a typo happened.
Note that due to a typo, I can't use require again to import
DatabaseSync
. Instead, I usually close and open the reply.What is the feature you are proposing to solve the problem?
Implementing a way to forget a variable would solve it.
The Erlang programming language doesn't allow reassignment, so a situation like the one described above might occur. To solve this, they have a utility function for forgetting a variable.
In the example below we can reuse
Message
after callingf(Message)
.NOTE: That would be good. However, I don't know of a way to do this in the current REPL. Please let me know if there's one.
What alternatives have you considered?
Using
let
when importing in REPL :)The text was updated successfully, but these errors were encountered: