Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run JavaScript code in VSCode's terminal? [duplicate]

I want to test small snippets of JavaScript code in VSCode's terminal before inserting them in my project. I want something similar to Chrome's Devtools console.

like image 836
Strategy Thinker Avatar asked May 10 '26 07:05

Strategy Thinker


1 Answers

Install node and npm from https://nodejs.org/en/download/

After installation in VSCode under terminal tab run node Paste your snippet to run your javascript code or use node filepath/filename.js to see result.

like image 86
Hunter Avatar answered May 12 '26 20:05

Hunter