JavaScript Full Course for Beginners | Complete All-in-One Tutorial

Let's get started with javascript we're going to use the chrome browser in this tutorial in the Chrome address bar type about colon blank and you will get a blank web page from there you can right-click on the page and choose to inspect from the pop-up menu or you can press the control shift and I key at the same time to open chrome dev tools with chrome dev tools are now open we have a web page on the left and your dev tools window may not be expanded as far as mine at first but you can adjust that by just pulling the bar over like this makes the web page a small column on the left of the screen and the dev tools are open on the right you can see the elements tab is selected let's change that by clicking the console tab and just to make the display a little less bright let's go into settings and choose the dark theme that took us back to the elements tab so let's choose the console tab again now we can type some javascript directly into the console.Please watch the video below to know more clearly:

Let's start out with javascript comments and data types, a javascript comment starts with two slashes we can leave comments in our code when we want to leave a note for ourselves or if we're working on a team with other developers javascript comments are simply noted now let's get into javascript data types there are four basic data types that you will work with in javascript all the time the first one is the string data type we need to enclose string data in quotes we can use double quotes or single quotes with string data I'm going to type my name into the console as string data and press enter the console replies with the string data I entered let's go ahead and use the type of keyword to have javascript confirm what data type do we have the console replies with a string let's use the type of keyword again for the number 42. the console replies with a number let's use the type of keyword again and let's type truly is a boolean data type you can also see using the type of keyword with false gets a response of boolean in the console clear the console window by clicking the circle with a slash through it at the top left now let's define a variable we'll use the keyword let if a variable is made up of more than one word you should use camel case this means the first word starts out with lower case but the second word and any following words in the variable name are capitalized we are not assigning a value to my variable right now let's just hit enter using the type of keyword with my variable tells us that the data type is undefined you have now been introduced to four javascript data types string number boolean and undefined let's take my variable and set it equal to my name. now we can see that my variable is a string data type instead of an undefined data type because we use the keyword let to initiate my variable we can reassign its value let's reassign the value of my variable to 42. now when we use the type of keyword my variable is the number data type let's clear the console again now let's look at javascript mathematical operators let's take the number 42 and add two the console replies with 44.

Post a Comment

0 Comments