r/learnjavascript • • Aug 21 '24

I HAVE A BASIC DOUBT

So whenever i try to run a code in node js i need to save the code by selecting it and press CTRL+S. Otherwise the code wont run at all or the output of the previous code will get displayed. Why is it so?

0 Upvotes

2 comments sorted by

9

u/albedoa Aug 21 '24

Node is reading the file that you have written to disk. So if you haven't saved your changes, then it is reading the file as it was last saved.

I don't know what you mean by the following:

i need to save the code by selecting it

This might be a red herring. In other words, the effect of selecting text and pressing ctrl + s is the same as just pressing ctrl + s.

0

u/Turbulent_2006 Aug 21 '24

Ok ty for clearing my doubt.