Having difficulty using my new IDE visual code studio

Tell us what’s happening:

i downloaded visual code studio but i cant seem to understand i

more info please. Let us know what you are having trouble with.

i tried coding in visual studio, i saved the file as .js file wrote some lines of codes and tried to get output but there is no result, it keeps showing errors

most of these lines of code are from what i have been practicing on free code camps, online developer environment

You will need to install Node.js if you would want to directly run javascript. with that, you can open a terminal window within vs code and type node yourfilename.js to run it

Alternatively, you can include the js file within the script tag of html and run it that way… there is a vscode extension called live server that will create a live server to show the html file.

1 Like

Put these files in the same folder on your computer (where “myApp” is the name of your project): myApp.html, myApp.css, and myApp.js

Then in the html file include:
<link rel=“stylesheet” type=“text/css” myApp.css>
And
<script src=”myApp.js” type=“text/javascript”></script>
If your using a language like React you have to put a compiled version of your code in the .js file.

Then when you navigate on your computer to the .html file and (double) click on it it will display your app.

code runner is a good extension for easily running your scripts and seeing your output in the output window.

live server is good for easily running your html file in a browser window. make sure you use the <scripts> tag properly to connect your js to your html

prettier is probably the best code linter to help you spot errors in your code

practice using the debugger to help you make sure your code is doing what you think it is. or just use console.log if youre lazy like most people.

@freelearner2019 every time a person installs a new program they have to learn how to use it. Some programs are more intuitive than others. What you can do is keep using it and after playing with it you will learn more and more. I started using the Vim text editor slowly, using only basic functions then, over time learning more little by little. I have used Vim for over 10 years now.

Or another good way to learn quickly is to watch a youtube video on it.