This is the most interesting part of the whole section, and that is we are going to write our first
JavaScript code.
Right now we have all the tools needed.
So let's see how we are going to start to write JavaScript code.
First of all, we need web browser and I'm going to use Chrome.
And secondly, we need text editor and we have it as VS code.
This is what we installed in the previous video.
So how are we going to get started?
First of all, we need to create a folder for our JavaScript code.
So on my desktop I'm going to create a folder called JavaScript Fundamentals.
And next step is I'm going to open this folder using VS code and we have couple of ways we can drag
and drop it on the canvas and I'm good to go or I can click on the file and open folder and on my desktop
I'll locate the JavaScript fundamentals folder and open.
To make sure that it has opened.
Click on this Explorer and let's expand it.
And this is the name of the folder.
Next step is we are going to run JavaScript in a browser.
Therefore we need a HTML.
So I'm going to create a HTML file called index dot HTML.
And here we are going to have simple HTML structure.
And I'm going to use Emmet by pressing shift and exclamation mark and enter.
And this is the blueprint of HTML.
I'm going to add H1 and I will say my first.
JavaScript code.
Great.
Now I want to open this.
Let me change the title here to JavaScript.
Next step is let's open this.
And we can do it manually by opening the folder and right click and it will open inside your default
browser.
And mine has opened here as that.
Or we are going to install an extension called Live Server.
So search for live server.
And this is the extension.
Click to install.
And this one we don't need to manually reload the page in case we make changes to our HTML after installing
the extension.
We're going to have additional folder.
So let's see to open that right click and open with live server.
And as you can see, I'm now running on my HTML on this server.
Now I can close the one that I opened manually.
And as soon as we do that vs code have created a folder for me.
It's because of the live server extension.
So don't pay attention to this.
And let me close these notifications.
Next step is how are we going to write JavaScript?
Remember, we are going to use JavaScript to interact with our HTML to be more specific in the browser.
So we have a couple of ways of including JavaScript.
And in the next video, I will show you a couple of ways.
For the meantime, we are going to write JavaScript in line with the HTML and here it goes.
You bring the angle bracket and type in script and close it as that.
So in here is where JavaScript code.
Let me see JavaScript code here so we can write any valid JavaScript code.
And for the meantime, since we are getting started, we are going to write only one line of JavaScript
code by using a method called console.
Console is a method.
Don't worry, we have a section to talk about methods and functions.
But console is a method that helps us to log or display some data into the browser.
So we make use of dot log and inside here we are going to pass in any text.
I will say Welcome.
This is my first JavaScript code with this one.
We have connected JavaScript with our HTML.
So where are we going to see this message?
We are going to see this message in the browser.
Now let's check it out.
If I open the console.
Now to do that, right click and click on Inspect.
And click on console.
As you can see, this is the message that has been displayed and this is my first JavaScript code.
And if you want to change the background color from black to white, we can do that by clicking on this
icon and under appearance and under theme.
Click on this drop down and select light.
And I prefer this.
So as you can see, this is our first JavaScript code if I add.
Something like, I'm glad.
Save it.
And now let's see.
As you can see, this is our first JavaScript code.
All right, don't worry.
We have a couple of modules to dive in about JavaScript.
So in this video, the takeaway here is how to include JavaScript in HTML.
In the next video, we're going to have a couple of ways of using JavaScript, meaning the right way
of using JavaScript.
Let's continue in the next video.