Now we are going to test if the HTML file can see the JS file.
Typing a simple hello world message.
And to do that I'm going to the main JS file and I'm going to type the command to the code to send a
message to the console.
I don't want to send the message to the actual HTML document.
I just want to send a message to the console because if we can get to the console, that means I can
get to the HTML.
They are on the same place.
So let's go.
The code is console, dot log, open and close parenthesis and inside.
I'm going to put a single code and inside of the single code it can be a double code as well.
Inside of the single code.
I'm going to type the Hello world.
Make sure you save your project, save the file.
Whenever you see a dot over here on the top.
That means we have a change on the file.
But that change hasn't been saved.
So when I save, I use command s or control s.
The dot just goes away.
And if I had to the page, I can see my hello world.
So let's just make sure that Hello World it is coming from my main dot.
JS So the Hello world.
Is inside of the console.
And this hello world is coming from the file Main dot JS, double colons and then the line number,
the line code number in our case, line number one.
So if you go back over here and check the visual code, it is the main JS and it is line number one.
So if I just copy this and paste underneath, I can send two console messages save.
Two exactly the same console messages, one on line one, one on line two.
So you may be thinking, okay, so that's how you had the message.
My name is Andre Iacono and I'm 28 years old.
Kind of.
There are two ways to do that.
So the first one is this.
So let's go over here and change for the first message.
My name is Andre Iacono, and yes, I am.
Kind of Italian.
And I am 28.
Years.
Old.
And then you may see actually with this, we just hit our first problem over here.
I'm using quotes, single quotes.
But the problem is when I'm writing, I am Java is JavaScript thinks the single code is started over
here and it's ending over here so it doesn't know the single code starts here and ends here.
He thinks it starts over here and lands over here.
Hmm.
What should we do?
So in this case, I'm going to change this single code for a double code.
When I do that, I.
I'm making the double quote clear that we should start over here and finish on the next double code.
Any single quality inside.
It's part of our of my text in the in this case is part of my string.
Normally I use single code.
Some developers, they like to use double code always.
Some developers always to like to leave a semicolon at the end.
Some don't.
Like myself.
I don't live the double the semicolon at the end.
It's a personal preference.
In today's day, you don't have to.
Used to be mandatory to to have the the semicolon at the end in today's day is not anymore.
So I have the message.
Let me save this file and see if I can get.
There we go.
That's the end result.
But the project doesn't end over here because right now everything is so static.
I need to let's say I have to change the name of the person.
Yeah, I have to come over here and change the name.
But let's say I'm using this piece of code somewhere down the line, so I have to change my name everywhere.
It's too static.
We need to find something more dynamic.
And when we are talking about dynamic, maybe we are having a reference to variables.
So the next class, I'm going to teach you a little bit about variables and how we can make our code
a little bit more dynamic.
So I see in the next one.