How to run javascript in visual studio code | Run Jscript in vs code | Code runner ext | QA Thoughts

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey hello everyone let's see how to run JavaScript in Visual Studio code in order to run JavaScript in vs code there are two prerequisites first you need Visual Studio code in your machine and then you need nodejs in your machine nodejs is the runtime environment for JavaScript so yeah noj is a crossplatform this is the runtime enironment for JavaScript so you need Visual Studio code and nodejs in order to run JavaScript okay if you don't know how to install vs code on node.js uh please uh see the description of this video and also I give the links in the uh cards of this uh video okay please uh watch and install this once you install both uh first let's openal Studio code uh after you install right the visual studio code might be available in your desktop icon you can open it and also the other way is in the search box uh you can type Visual Studio code uh the best match will be made and you can click there okay now Visual Studio code is opened the next step is I we have to open the folder if you see like after Visual Studio code is open right you can see this open folder I mean you'll be landing in this Explorer area okay there from there you have to open the folder so there are uh multiple ways to open the folder it can open from here and also you can open from um the Windows Explorer also I will show you both the ways okay here if you want to open click on open folder uh navigate to the folder where you want to create your folder click on new folder and uh let's say type JS test okay and select folder okay the folder will be created and uh here you can create your JavaScript files okay this is one way you can open the folder let me show you another way so we have created a folder right JS test folder just open the folder and inside that folder uh right click and uh click on this opening terminal option okay this is a PO uh terminal actually here type code just type code Dot and click enter this will also open the uh same visual studio code in this inside this it will open this folder actually okay you can you can see JS test folder is opened here and this is how you can open the folder so once you open the folder uh in that folder only you're going to create uh your JavaScript files okay uh let me Zoom this for you okay and now it is good uh uh here click on this plus symbol okay this is for new file and this is for new folder we need a new file now actually so click on this new file and in that file I let's say first test.js okay JavaScript files must be with the extension of JS okay then only it will identify as it's a JS JavaScript okay here uh first uh let's say add a command like uh my first code and then command sorry the code should be console.log and then yeah this is my first code sorry okay we have written our first line of code now you can save this file you can go to file save or uh just uh press control save control+ s in your uh keyboard okay now in order to run this there are multiple ways you can run this uh the first way is uh you can open Terminal and then click on new terminal okay so the terminal is opened you can see uh the poell terminal is opened here you can run your Javascript file before running let's see uh which node version is there or whether node is available or not or that type node hyph version okay node 20.0.0 is available uh now we are Cod so we can run this file for that uh enter this command node space and just uh enter this uh file name okay it is already inside the folder you can see it is in desktop JS test already so you can just enter the command node space first test that's my file name first do first test.js Okay now click enter your code is run okay this is my first Cod this is one way of running this is you're running through terminal okay uh the other way you can run is you can install extension and you can run it like you will get a run button here and you can run it like how you run in other ID tools okay uh so you currently we are in the Explorer pane uh navigate to extensions pan okay here type code run the first option will come right it's a code Runner just install this extension okay once you install this extension itself you will find this run button here okay close this one back to Explorer I'm opening the file again now if you see the Run button is available here okay just click on run now you can see the code is run but it is not in the terminal it is in the output now that extension has given the I mean it did the job for you right uh the done exited with uh 0.11 seconds okay now if you want to change your code yeah this is my first code yes it is and save your file click run right it is running and yeah it is executed and this is uh the execution result okay this is how you can run your Javascript file in Visual Studio code it is quite easy right let's explore the other Concepts in the upcoming video thank you for watching
Info
Channel: QA Thoughts
Views: 229
Rating: undefined out of 5
Keywords: vs code, Visual studio code, install vs code, vs code in windows 11, vs code installation, qa thoughts, complete vs code installation, how to run javascript in visual studio code, run js in vs code, run js, run javascript, js in vs code, run js in vs, js in visual studio code, code runner extension, run js from terminal
Id: Vs0MXOyl0FA
Channel Id: undefined
Length: 6min 28sec (388 seconds)
Published: Sat Jan 06 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.