- Open Terminal or Command Prompt.
- Set Path to where File is Located (using cd).
- Type “node New. js” and Click Enter.
- Open Chrome on your computer.
- Click. Settings.
- Click Privacy and security.
- Click Site settings.
- Turn on Allowed (recommended).
Running a JS program from the command line is handled by NodeJS. Start by installing NodeJS on local machine if necessary. Now simply open the command line in the same directory as the index. js script you created (VS Code will do this automatically with the integrated terminal).
With the Chrome Developer Tools window open, click on the “Sources” tab. If you don’t see anything you may need to click on the “Show Navigator” button in the upper-left corner of that tab. With the navigator open, navigate to the file where the cut() function is defined (in your case it’s demo. html ).