I am surprised this has not been mentioned yet:
Simply open the .js file in question in VS Code, switch to the 'Debug Console' tab, hit the debug button in the left nav bar, and click the run icon (play button)!
Requires nodejs to be installed!
Answer from tenwest on Stack OverflowI am surprised this has not been mentioned yet:
Simply open the .js file in question in VS Code, switch to the 'Debug Console' tab, hit the debug button in the left nav bar, and click the run icon (play button)!
Requires nodejs to be installed!
This is the quickest way for you in my opinion;
- Open integrated terminal on visual studio code (
View > Integrated Terminal) - type
'node filename.js' - press enter
note: node setup required. (if you have a homebrew just type 'brew install node' on terminal)
note 2: homebrew and node highly recommended if you don't have already.
have a nice day.
Videos
So I am actually a beginner in the coding world. I learn python some months ago and now I want to learn JavaScript but i don't know where to begin with. I read throughout the internet like download node.js and all but I didn't some how understood that can you correct me in the next lines if i am lacking some information:
To type javascript in VS code I need to download node.js
Then I have to open the VS code and fetch the file extension with js And anyone correct me and guide me after 2nd step
Or is there any other way to start with js without much hustle Like someone had written that you just need a browser to learn js and can be performed in console section of the browser
Hi,
I'm trying to learn programming in JavaScript.
I installed node and VScode.
I created a simple js file and trying to run it via node.
When I execute the file in the terminal it works but I would rather use the "Run and Debug" button in VScode to also get the posibility to step by step debug.
But when press "Run and Debug" it shows this and not the result/output of my code:
https://imgur.com/a/rtfWBDH
Any ideas how to run my code via VScode?