You will probably need to start a web project to run the JavaScript in. I believe there are tools to use JavaScript as a console language, but this would require some extra setup. These scripts are intended to be executed by a browser.
Try this:
Another option would be to use a site like JSFiddle. https://jsfiddle.net/
It will help you to have a basic understanding of CSS and HTML while learning JavaScript. W3Schools has some excellent beginner guides for HTML, CSS, and JS.
One option is to install Node.js .
Then open a terminal window and type node filename.js
and it will execute the JavaScript.
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.