How to use virtual studio or Atom for Beginners

Hello guys, am new to coding and i need to know how to setup a console.log window on VS or Atom for testing my code,
Thanks

Hey, you can’t really immediately get a log from console just from the editor. You have to either run it on the browser if it’s a web app, or use Node to run it directly on the editor. I’m gonna tell you how to get it running on Visual Studio Code (VSCode).

  • If it’s a web app, then first of all, you’re going to have to install an extension called Live Server.

    • After you installed it, you’re going to see a Go Live Button on the bottom right of the activity bar.
    • Make Sure you are opening your Index.html, and your JS is linked, then press the Go Live button. It should open up a browser.
    • Then you can press CTRL + SHIFT + I. Then you’re gonna see the console tab. There is where you’re going to see your console.log()s.
    • This is what it would look like (Ignore the errors, it’s because I’m not using a Web App):
  • If it’s just a JS file, then you can use Node.

    • First of all you have to install Node.js. You can go here: https://nodejs.org/en/ and install the LTS Version.
    • When that’s done, you just have to go to your JavaScript File in VSCode, then you have to open the terminal.
    • You can do so by dragging from the bottom, or by pressing CTRL + ` .
    • Then you’re going to type in node your-file-name.js in the terminal. It’s going to run your JS using Node, and if you have a console.log(), it will log it in the terminal like the image shows:
  • Hope this helps !!:slightly_smiling_face: