In this lesson, we're going to be showing you a little bit more about JavaScript, and I am going to
get you to write JavaScript by the end of the lesson.
So we're going to show you more about JavaScript history.
So, of course, there's a whole lot more to it.
But essentially, it started in 1995 as an answer to make browsers do a little bit more functionality
and make them more interactive.
And this was initiated by Netscape.
Netscape originally called Live Script, and then they renamed it to JavaScript in 1995.
So JavaScript is only similar in name when compared to Java and ECMAScript came along.
So you might be familiar with ECMAScript as well when it comes to JavaScript.
And this is in reference to the standardized format of JavaScript.
So currently there have been nine different s versions and as you can see within the chart.
So currently as we're making the video, we're at ECMAScript nine, which is ECMAScript 2018.
The major revision was with S six and that was with ECMAScript 2015, where there was a whole bunch
of changes.
And before that, you can see that there wasn't an annual change.
So the big difference really came with 2015 and the changes.
And most of the modern browsers right now have incorporated the changes from 2015.
And as mentioned earlier, there are some differences on how browsers handle JavaScript, but they all
handle all of the core fundamental concepts of JavaScript the same way.
And that's the good thing about it being standardized.
So JavaScript is everywhere.
And I guarantee your favorite websites use JavaScript.
It makes things come to life and allows you to create interaction and have dynamic content within your
language.
So it's applied programming language.
It's applied with an HTML and basically it brings your HTML to life.
It's available in all browsers.
And it's the most popular programming language out there and with websites and web applications, JavaScript
rules.
So what is programming and what is code all about?
So code really is inside of instructions.
It tells the computer or the browser what you want it to do.
So that's a simple explanation of what code is.
And then the code renders out and helps deliver what the developer or the programmer wanted the interaction
to take place.
So, for example, if we have a person that comes to your website, you want to ask them their name
and show a welcome message.
So this might be a common thing that you have on your website.
So you want to first ask the name.
So in this case, it will be Lowrance.
We need to provide a place to input the name as well as an interaction for the user to send the name.
And then we have a response saying hello, welcome Lawrence to the website and behind the scenes, this
is the code that makes it happen.
There's not a whole lot of code that is needed.
And as you can see, most of this is just regular HTML and then the JavaScript builds upon the HTML
and makes it interactive.
We are also going to be utilizing the Chrome browser console.
So we did mentioned this earlier.
It's available in every version of Chrome and most modern browsers will have a developer tool option.
So what I want you to do now is to try this out, to open up your browser and access the console, and
I'll show you how to do that, walking you through so you can open this up on any Web page.
And in this case, I've got brackets open, so why not go to inspect so you can.
Right click anywhere on the page on a Windows machine.
And there are also shortcuts in order to do this.
So you can go to more tools and developer tools and there's different shortcuts for windows and for
Macs.
So typically the easiest way to do it is just to click anywhere on the empty page and just hit the inspect,
which will open up the inspector option.
This is the developer console, a default.
It gets docked to the right hand side and you can move where your docking it for most of the course.
I'm going to dock it at the bottom.
So this gives me the most screen for the buck.
And when you see there's a different tabs here, there's elements, console sources, network performance,
memory.
So the one that we're focused on is console.
You can clear that out by pressing the clear console or control L or or command K on a Mac and that
will clear it out.
Or you could also type in clear and that clears the console as well.
So what you type into the console is only available in this current instance of the browser.
So if I was to type in some JavaScript like an alert saying hello, you see that that alert pops up
and even though it's render do it on Brackett's website or it looks like it's rendered out in the brackets
website, it's only within this browser instance of it.
So when I refresh it, that code goes away and we are going to be using it in order to debug and communicate.
So try that out.
As mentioned, it is our way to output a message in the console from the developer, from the code,
and we can see that information directly in the console.
So for most of the course and whenever we want to output information from.
Directly, we're going to be using console log so it prints out content and this is only visible within
the console, so it's not going to be visible to the average Web user.
This is just our way to debug programs.
There's also a console directory, a way to list out an object so you can try that one out as well,
where you can go into your browser and just type yourself a little secret message.
So this case, we're saying hello.
We see that it gets rendered out within the console, of course.
And if we do console directory, we're going to use the document object because this is already loaded
within the Web page, within the browser.
And as you can see, it returns back this document object and then within this document object.
This is huge.
There's a lot of stuff in here.
And what this is doing is this is giving us all the information of what's contained within the Web page.
And this is essentially a giant JavaScript object with a ton of information.
And we are going to be covering objects later on.
So there's more on this.
But this is just something to be aware of for now, and it's something that you could try out and render
out.
And then, of course, you can look through it if you want and see all of that information that's contained
within the Web page.
And then, of course, JavaScript gives us the ability to interact with this object and then manipulate
it, change it, update it and do some really nice things with it for the console.
There's also a console table.
So this is ideal for outputting an object within a table format.
And there's also console error and then console clear to clear out all of that console content without
having to refresh the page.
So what I want you to do now is open up your browser.
And if you haven't already tried it, type in console log hello world.
And then also type in more than one line so you can type in a variable.
And we are going to be covering this in the upcoming lesson.
So this is a sneak preview to what's coming up.
So set up a variable by var space A and then equal it to end quote around any kind of message that you
want.
In this case we're just doing hello so you can use double quotes or single quotes and then use the console
log to output that a and I'll show you how to do that.
I'll walk you through.
So you can pause the video and try this out before moving on to the next lesson, can try it at any
one of any any webpage at all.
It doesn't matter in this case.
I'm going to be using it on Brackett's.
So what the challenge was for this lesson is to type out a message to yourself within the console using
console log, and you can see the output being output there.
And also is to set up the variables we're going to set up.
Örvar, equal it to a is equal to low and you still sensi undefined being returned back.
But now when you output a you're going to see that message being returned back.
And as well, if you do console log, then you can see that that message is being returned back into
the console.
So that was a sneak peek at what's coming up.
So go ahead and try this out for yourself.