Complete JavaScript Course For Beginners to Master - 2019 | Daily Tuition | Skillshare

Complete JavaScript Course For Beginners to Master - 2019

Daily Tuition

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
73 Lessons (8h 34m)
    • 1. Overview of JavaScript Course

      1:38
    • 2. JavaScript Tutorials Serious Part 01

      3:36
    • 3. JavaScript Tutorials Serious Part 02

      8:07
    • 4. JavaScript Tutorials Serious Part 03

      7:55
    • 5. JavaScript Tutorials Serious Part 04

      8:09
    • 6. JavaScript Tutorials Serious Part 05

      15:08
    • 7. JavaScript Tutorials Serious Part 06

      9:26
    • 8. JavaScript Tutorials Serious Part 07

      8:20
    • 9. JavaScript Tutorials Serious Part 08

      7:59
    • 10. JavaScript Tutorials Serious Part 09

      5:42
    • 11. JavaScript Tutorials Serious Part 10

      5:23
    • 12. JavaScript Tutorials Serious Part 11

      8:39
    • 13. JavaScript Tutorials Serious Part 12

      8:44
    • 14. JavaScript Tutorials Serious Part 13

      5:25
    • 15. JavaScript Tutorials Serious Part 14

      5:16
    • 16. JavaScript Tutorials Serious Part 15

      5:41
    • 17. JavaScript Tutorials Serious Part 16

      6:56
    • 18. JavaScript Tutorials Serious Part 17

      6:03
    • 19. JavaScript Tutorials Serious Part 18

      5:09
    • 20. JavaScript Tutorials Serious Part 19

      6:10
    • 21. JavaScript Tutorials Serious Part 20

      5:14
    • 22. JavaScript Tutorials Serious Part 21

      4:49
    • 23. JavaScript Tutorials Serious Part 22

      4:42
    • 24. JavaScript Tutorials Serious Part 23

      6:23
    • 25. JavaScript Tutorials Serious Part 24

      5:04
    • 26. JavaScript Tutorials Serious Part 25

      6:14
    • 27. JavaScript Tutorials Serious Part 26

      9:44
    • 28. JavaScript Tutorials Serious Part 27

      5:07
    • 29. JavaScript Tutorials Serious Part 28

      5:13
    • 30. JavaScript Tutorials Serious Part 29

      5:57
    • 31. JavaScript Tutorials Serious Part 30

      5:49
    • 32. JavaScript Tutorials Serious Part 31

      5:33
    • 33. JavaScript Tutorials Serious Part 32

      8:12
    • 34. JavaScript Tutorials Serious Part 33

      7:17
    • 35. JavaScript Tutorials Serious Part 34

      5:32
    • 36. JavaScript Tutorials Serious Part 35

      7:07
    • 37. JavaScript Tutorials Serious Part 36

      6:16
    • 38. JavaScript Tutorials Serious Part 37

      6:06
    • 39. JavaScript Tutorials Serious Part 38

      6:48
    • 40. JavaScript Tutorials Serious Part 39

      12:45
    • 41. JavaScript Tutorials Serious Part 40

      5:23
    • 42. JavaScript Tutorials Serious Part 41

      8:31
    • 43. JavaScript Tutorials Serious Part 42

      7:26
    • 44. JavaScript Tutorials Serious Part 43

      7:18
    • 45. Advance JavaScript Tutorials Serious Part 44

      4:53
    • 46. Advance JavaScript Tutorials Serious Part 45

      4:30
    • 47. Advance JavaScript Tutorials Serious Part 46

      7:29
    • 48. Advance JavaScript Tutorials Serious Part 47

      6:51
    • 49. Advance JavaScript Tutorials Serious Part 48

      7:36
    • 50. Advance JavaScript Tutorials Serious Part 49

      7:26
    • 51. Advance JavaScript Tutorials Serious Part 50

      7:00
    • 52. Advance JavaScript Tutorials Serious Part 51

      8:16
    • 53. Advance JavaScript Tutorials Serious Part 52

      9:08
    • 54. Advance JavaScript Tutorials Serious Part 53

      5:20
    • 55. Advance JavaScript Tutorials Serious Part 54

      8:04
    • 56. Advance JavaScript Tutorials Serious Part 55

      5:40
    • 57. Advance JavaScript Tutorials Serious Part 56

      6:37
    • 58. Advance JavaScript Tutorials Serious Part 57

      4:06
    • 59. Advance JavaScript Tutorials Serious Part 58

      7:10
    • 60. Advance JavaScript Tutorials Serious Part 59

      6:48
    • 61. Advance JavaScript Tutorials Serious Part 60

      5:56
    • 62. Advance JavaScript Tutorials Serious Part 61

      6:37
    • 63. Advance JavaScript Tutorials Serious Part 62

      7:33
    • 64. Advance JavaScript Tutorials Serious Part 63

      6:35
    • 65. Advance JavaScript Tutorials Serious Part 64

      6:11
    • 66. Advance JavaScript Tutorials Serious Part 65

      5:37
    • 67. Advance JavaScript Tutorials Example Part 66

      8:51
    • 68. Advance JavaScript Tutorials Example Part 67

      9:05
    • 69. Advance JavaScript Tutorials Example Part 68

      11:06
    • 70. Advance JavaScript Tutorials Example Part 69

      10:50
    • 71. Advance JavaScript Tutorials Example Part 70

      10:49
    • 72. Advance JavaScript Tutorials Example Part 71

      6:33
    • 73. Advance JavaScript Tutorials Example Part 72

      13:25

About This Class

In this course, You going to learn JavaScript really from scratch. Well, there are lot's, of course, are available to teach you JavaScript but most of are use complicated words and English. In this course, you will learn JavaScript really from the basic with simple English language. We are going to cover all the necessary topics that you need to learn to become a master in the JavaScript course.

But what actually are you going to learn?

we will start from the environment setup of the editor. Then we will understand what is JavaScript and History. Following is the list of topics which we are going to cover in the course.

1) What is JavaScript and History of JavaScript

2) Operators

3) Variables

4) Conditionals

5) Loops

6) Jump Statements

7) Objects

8) Arrow and Anonymous Functions

9) Destructing Arguments

20) Array

21) Modules

22) Ajax

23) New ES6 Syntax

24) Date Object

and a lot more.......

Well, this course is a complete course to learn JavaScript really from scratch. If you are a beginner this course is really for you. we will start from the basic to advance tutorials.

Enroll in this course i will see you in the course....!

Transcripts

1. Overview of JavaScript Course: everyone. My name is Zak Chickasha on Welcome to JavaScript. Course I'm going to be a instructor of discourse. I'm a web developer and I have all those seven years of experience in this course. We will learn the complete JavaScript language really from scratch. If you're new in the Web development industry, then you must know the JavaScript language because nowadays just is a mother off. All Web development languages in this course will cover all the concept behind the JavaScript language on understand the latest here. Six standards. We're going to learn the beginner toe master level of development in only eight hours. There are a lot, of course that have repetitive explanation. But in this course we're going to the business only for understanding how you can use JavaScript in the modern world. All the examples in the schools, his real world examples Well, in this course, you're going to learn data types or potatoes condition, ALS loops, objects, Addy functions, Ajax glasses, models and lock mark. This ghost is separated into three sections. The first section is going to describe the basic understanding of JavaScript. Then we'll dive into the second part wherever Landy advanced. Topics and master in the JavaScript and in the third section will just take some simple example to understand how javascript work. So if you want to become a Vape developer than this course is definitely for you, you spend a lot of money in interview to learn all this concept which you are letting in this course. After completing this course, you will get certificates off completion. So what? You have to lose. Really? So Enderlin this course and become a Web developer. I will see you in the course. 2. JavaScript Tutorials Serious Part 01: So in this lecture will first talk about what is JavaScript history off JavaScript. Then we'll talk about it. Musk ripped and then wilt up about what is E. Six. So before beginning late, let's get started. So we will first take a look. What is Javascript? If I want to simply describe JavaScript, then I will say Jo script is a client side scripting language that execute on your browser . JavaScript essentially used to make your peace alive. Using JavaScript, you can capture event, create animations, validating the user input and much more. But as I said, the President JavaScript not only transponder client browser, but also on the server. No, Jess is one of the most amazing example. Off server side JavaScript language. There is Trump's offering book that scripted in the JavaScript language he was in JavaScript. You can do anything if you have a power off imagination. Anyway, let's talk about history of JavaScript. Javascript Waas. Developed by Brendan Ache in 1995 he's a developer in Netscape Communication Corporation. In 1995 JavaScript started his life with the name Mocha and what concisely named Life script in 1995 life scrape officially renamed toe JavaScript with Netscape Navigator. Bradley's job was very popular language at that time, so to tie success, life script greening toe JavaScript. Now let's talk about what is it? Musk ripped Pickman stand for European Computer Manufacturers Association, the nonprofit private international Standard organizations. In 1996 Netscape announced that he had submitted Jealous Give Toe Sikma. So Sigma International published the first edition off Sikma 26 specification. So the relation between equal specification called make muskrat JavaScript just the implementation off musket. So get that into account. Now let's talk about what is he as six year six is Sigma Script six here six is the update off Sikma Script fight. You can also call as he s fight, which was standardized in 2009 Here, six waas published on June 2015. At this time this is the latest version and we are making all the editorials on the latest version. By investing your time in learning it now, you will be prepared for the future. That's it. Now you're Terry is completed. You know the basic off jealous gift. Now you know what is jealous? Gift history off JavaScript. What is it must grip on. What is he? As six. And that is all for this tutorial. We will see you in the next lecture. 3. JavaScript Tutorials Serious Part 02: Hey, guys, Welcome back again in Javascript, Oreo. In the previous video, we learn What is a JavaScript history of JavaScript? What is it? Musket on What is E. S six now? In this lecture, we will create our first JavaScript program with hello word. Now the first thing we just need to write JavaScript program is browser on text Editor. We need text editor to write the program off JavaScript and to run that program, we need browser. There are different free browser in the market so you can download it and installing your computer. You can use note pad as a deter, but there are more powerful editor available in the market just like brackets at all. Sublime text. Visual to record on a note pad plus plus etcetera. In the whole JavaScript tutorial, cities were using regions to the Accord Text Editor. This editor is very powerful and has a new features just like auto completion. Syntax highlighting brackets, matching court folding and so on. After that, we will also take a look. How to create a comment in javascript court coming are used to specify court explanation. If you are or your fellow programmer need to know what going on in the court, Then command will help you to describe what is happening. Most programmers used command for documentation. We will discuss how to write a single line comment on a multilane. Commit to install editor in your computer. Just go to Visual Studio, Court, website and from here don't know divisions to the court has for your sister. I am using Windows seven, so I will download the 64 Peter version I already downloaded and install it in my computer . So now you just need to download and install these. We just Sharia court in your computer after installation, open digital studio court and install very important extension. Life's over to see live result off your project. This extension is very helpful. So just goto extension time from here and such for life server installed his extension in visual Studio Court on Reloaded. Now just click on the Explorer. Project reports need to create an empty folder in computer, so we first create an empty folder on this stop. You are free to choose your own location to create a new folder. So to create a folder I've rightly here and select a new folder and name this folder JavaScript. Now, I just wanted toe open these folder in regions to the court. So I will click on the open folder button and select my empty porter. Right now, your project is ready to build. We'll create our first JAVASCRIPT files to create a file in visual studio Court. You can click on this icon are you can go to the five million on Select a New file. There is one more way to create a new file, just rightly in the Explorer and select new file. But I will choose the first matter to create a new file so I will click on this icon and specify name for this fire. So I would just say index dot html and press enter Now, index file is created in this file before to create a simple HTML five snippet to create a quick snippet. Just type exclamation mark and place tap. Now you have a simple Stephen five snippet with esteem. Oh, head title on body types. I would just Jane you my title and space if I jealous script here to insert a contained in the estimable document, we specify element in the body dunk the same Be jealous crypto work. But you can specify JavaScript in the head also. But this is not recommended to use a JavaScript in the head because the JavaScript will execute before the document object model. We will talk about a document object model in the subsequent lectures. But now just keep in mind space if I just er file in the bottom off the page before the closing body type. So if you execute JavaScript court before estimate element completely loaded, then you will get an error message so we will create a script back in the body section before the closing body type here. Reused script back to space. If I JavaScript core in the esteem of file just like you're using this style attack in estimable document to specify CSS court cascading style sheets court Using script. You tell the browser that this is gift bag and I am inserting a JavaScript court inside of this script act so the browser will take this court as Saoirse kept court now to create a message on console, we will write in the script time console dot Lock on in the parentis is to specify a message, which we wanted to display so in the parentis is with specified double courts. Tell the browser this is the strength we use double court. You can use single court. Also, to specify our strength console dot long is a function that brings a message on the console , so I will just say hello would here and just saved the document now to describe what we had done. Here we are inserting a comment to insert a single line commit you can use to forward slashes and specify your coming to create a multi line comment you can use reporter slash on a strict on in wit Estrich on a former slash Like this, especially for your mother and comment here. Now, to execute this file right click on the HTML file and select Open with Life Server. This will open your browser and you will see live Result off your project. But wait, what is your message? If you read the court carefully, then you will see we print this message on the console to see your message. Right click here on select Inspect Now on the right side off the screen, you will see the element click on the console tab. That's it. Now this is your hello world text. Now you can print anything here. You can train your number, your name, your board. Date on anything. That's it. Now you know how to install editor in your local computer on how to print a massive in JavaScript. In the next lecture, we will move forward and learn data types in javascript. That is all for now. We will see you in the next lecture. 4. JavaScript Tutorials Serious Part 03: everyone. Welcome back to JavaScript. Tutorial cities. In this lecture, we will talk about liberals, variables and constant well. First, take a look what is variable. Then we'll take a look what is constant and then we'll move to the Littles, and we'll also take a look how to create variables constant and literally in Jascha. So let me first tell you what is variable. If I wanted to simply describe a variable, then I would like to say very vote is just a name off a specific value. This value can be changed any time. Just think. If you want to store age, then you can use a variable to store the age values. But when you call your age, it is very difficult to call the exact age really in that situation really will help you out. You specify a name for your age and access this name anytime, anywhere. So now let me first tell you how to create a variable to create a variable. We will, right? Age is equal. Do 24 on, then to specify a semi colon. Now this statement does Two things it declared are yet a variable each on assigning an initial value 24. You can change this value any time. If you want to display this variable reuse console dot love matter and in the Parenti sees I will just race if I the variable name. You don't need to specify devil court here because we don't want to display a string message. Except we just wanted to display a variable on the console. So we'll just say age in the parent disease. And in the statement using semi column. Now, when you run this document, you will get 24 on the console. But this is not the way you declare a variable. Okay? If someone wanted to run this document in the stick more, then you will get an ETA message. Read me. Access the age video. We will talk about these youths. Strict, literal in the future lectures how to use a variable in a musket six. We can use let giver before the variable name using late giver, we will create a variable Are you can say we boot declare a variable with a value or without help. If you remove this value from the variable, then you will not get an error message except you will get a special undefined rally. So this statement is equivalent to Let's age is equal to undefined, right? No, you can declare multiple variable at the same time. Read the late giver just like this. So we'll declare. Let first name Mama Last name is equal to in the double court will specify daily Duchin on you can create one more variable with the different value. So just say comma and space If I each is equal to 24 on in the line with the same color in the last name variable we declared a string value and after that we create a variable with the number value. Now let me move to the next topic, which is constant in Big Mosque up six a new giver added in the javascript which is foster constant also hold value. But unlike variables, it can't be changed after in its logician. You can't cheat the constant value after you declare it. Let me show you how to create a constant variable. So to create a constant variable, start with the constant giver followed by the name off your constant I was specified in preacher here, So just say Tampere and space. If I number to create another constant, just type Goma on space. If I your second constant here, you can also specify the string value to the constant. I was not used the capital later to specify the constant because it is very helpful to understand and find out where it is constant and variables now. The next topic is what is identified. Variable and constant are usually called identify, and they have a naming roots. Identifying consist off letters. Numbers under schools and the dollar sign Unicode character are allowed. Identify where most start with the later dollar sign. Our underscore identify their cannot be a bizarro world. These are the words are the words in the JavaScript that created for a specific task? They can't be used as a identified. If you do that, then you will get an enemy message. Now let me move to the next topic. Liberals. We already seen the literal in the previous example where we specify a variable name with the numerical little's so literally means you are providing a value directly in the program , literally just a waste to create identify her with the rally. So let's create available with the late giver and named this valuable gold. Now we'll specify the literal through this variable, so just five equal sign on then in the double court, we specify Dorio, make happy and just closed the statement using a semi colon in the double court, we specify a literal. You can specify this literal toe, the other valuable also. So just say let reference is equal to go now. The difference has the same value as the gold variable. You can specify a literal with the new medical value with the float value will talk about this in the later Orioles. It's upon you where the use of variable on where to use constant in your program. So now we understand what is variable constant on literally. When you move in the JavaScript series, you will completely family with the stop, it's we will take each topic one by one, so you will understand everything in detail. That is all for this lecture. We'll see you in the next one 5. JavaScript Tutorials Serious Part 04: In this tutorial, we will discuss data types in JavaScript. There are two types of data type in javascript, primitive type on object type. So in this lecture we will discuss primitive types. Keep in mind Jascha data, or you can say values are at the primitive. Our object. Primitive data types are immutable. Immutable means you can't change the value off the variable after you initialize it. Let's take an example. In the previous lecture, with specified 24 value to the age variable, the number 24 will always beat the number 24. You can't change it the same way string also works. If you specify a string for a particular variable, then you can't change the string because it is immutable. If you specify 30 to do the each variable, then you will get 32 on the console. The variable value is modifying. It is not. When you specify a new value to the variable, it will not modify the previous value, but instead of this, it will create a new variable the same way I work for the string type also. But what if you can coordinate to string using plus sign using plus sign. You can concurred in +82 strings, but keep in mind. As I said, string is also immutable, so the con coordination represent a new variable. Will you concurred in it to string. It will create a new variable with the contract in ated strength, not the modified string. JavaScript recognized full type off the new medical literal. Finally, they see more octo hand exit using a day seem a literal you can specify in number decimal value with 10 exponential notation. Then you can specify exactly Simo Octo on a special value, which is infinity on negative infinity. We also have a special word, not a number to space. If I This is not a number, but infinity and not a number is not a numerical literal. It isn't but this value taken as a space holder, let's move to the next top E string. In the previous lecture, we learned how to declare a string Literal thing is just a simple takes. Data. We can specify string in the single or double cords or you can use both. We will not dive deep into string toppy because it is beyond the video, so we will clear all the concept and all the small detail in permission off string in the separate video. So I had just cleared the basic concept off string here. Now I will move to the next stop E ridges bullion. What is brilliant bullion is just a value type that have only two possible values. Do are false, but be careful when you're using the bullion type. If you intended to use a bullion, then don't specify the bullion. Type in the quotation mark. If you specify the bullion value in the quotation than the literal equals to the string Little's the best way to create a bullion type is this. Don't just say let do is equal to true and close this statement with semicolon. We'll create a one more variable lift. More is equal to folks. Your bullion type is created, so now let's move to the next topic. Seem bots in Moscow. Six. We have a new type symbol. Symbols is a new data type in Year six, which represents a unique neocons. Once you create a symbol, it is unique on it will not match any other symbols. In the future lectures. We will take a brief look off symbols, but just for the basics. I just wanted to show you how to create a symbols. Symbols are created using symbols. Constructor. We will learn what is constructor functions on all that in the future lectures. So we'll just say const, which is constant value, So we'll just say Constant do hes equal Do seemed block on. This is a constructor, so specified guarantees and just close the statement using semi column at the end. Now we'll create one more constant using Const right is equal to symbol on in the Parenti sees we specify a string to create a stream we're gonna add double coat on will say color white And then we close the state when using semicolons. No, If you take both constant, then you'll gate falls because, as I said, symbols are unique. Every single has a unique token, so if you print the statement, you will get false. Now let's move to the next type. No, on undefined job script has to special fight No, on undefined no has only one possible value, which is no on undefined has only one possible value. Undefined. Both know and undefined represent something that doesn't exist. It means you haven't specify any value to the identify, but most programmer used no type to check. The value is exists or not. You can also use undefined. But giving undefined value to the valuable is sometimes complicated because if you specify variable without explicitly specifying a value, it will have a value undefined body for So let's take an example now will force create, let my value and closed the statement using singular. If you print this statement, you will get undefined because it is the default value. Then we'll just edit the statement on space. If I let my value is equal. Dude, no, If you print the statement, you will get No, no, just James. This now toe the numerical value. So just stay here 19 point fourth if you print the state, when you will get 19.4 from the console and at the last give you space. If I undefined, then you will get the same result undefined as default. That's it. I hope you understand. The primitive types off gasket in the next lecture will explore object types 6. JavaScript Tutorials Serious Part 05: in this lecture, we'll talk about object type in JavaScript. In the previous video, we'll talk about primitive data type in JavaScript. Now, in this lecture will cover object type. There are five type of objects. Ari. Date regular expressions. Map on Vic Matt State and freaks it in this lecture. Full court. All this fight object with their syntax. Now let me first talk about what is object. Object is not like a primitive type that immutable on take only one value at the time. Object can represent multiple and complex values. It is mutable, so you can change any value off object anytime. Object. I always work like a container. You can put a different kind of data in the country now Object how little syntax open and closing. Curly braces like this. This country braces allow us to express an object content, so let's create an simple object so we'll just say const. O B J is equal to open and close curly braces on closed the statement with semi you can put your contained inside these curly braces. The contained often object are called members. You can also call them properties. Members are you can say properties consist off key and badly fear the properties case is must be string are a seam ball on ah, value is can be anything. For example, primitive type are object, so let's create property. Often object to create a property you can just face. If I object, dot your property name. You can also specify value so that particular property are. You can leave that as it is, so it will take a deport value. Undefined property name must be a valid identified In the previous videos, we talk about what is identify is all about, so let's take an example off object with properties to create object with their properties . You need to take care off these things first. Object property are always specified in curly braces. Second, two separate properties. You can use a comma, two separate key and value. You can use colon. Now let's take an example off how to create a simple object so will first create constant object. So we'll just say const Pool B J is equal to in the country. Braces will create property, so we'll create the first property name on to specify value. We are colon and space. If I string Sandy. So this is the value off the key now to create the next property, we need to separate them, so separate them, specify comma and create a new property with the name age and specify each value. So we will just add colon on. Here we specify 24. You can create a multiple object with multiple properties. So in the Abu example, we created a O. B. J object on In the curly braces. We specified two properties with the key and value fair. So we specify King name on. After that we specified colon and then we specified value off. That key is Sandy. After that, we specify one more property with the key age on Value 20 port. You can also create a function in the object. We will talk about this in the future tutorials Now to access the object value. We will just specify the object name dot The property line. That's it. Now you will get the property value on the console. There is a complex. Objects are there in the JavaScript language. But for the beginner level, we'll just take the basic objects. We'll talk about the advance object in the ad want soundscape tutorials Now, If you want to delete the object property, then you have to specify delayed keyboard. Don't believe the object property from the object. So to delete eight property will specify the league o b j dot property name So space. If I age and specify cynical and at the end of the statement, that's it. Now your property is diligent. If you're from the object oriented programming, then this concept will not really hard to understand. Now let's move to the next topic at it. I didn't just a collection of data, so the data means here a collection off different types. It is primitive on object. Adam is a sequential data that start with zero and end with, and so the end refers to the endless value. So let's take a look at the important features off Harry. At Element can be any type of data. It maybe object or primitive. Either size is not fixed, so you can add and remove at element any time, and it is zero base. So the first element off the ari is zero, and the next element is one and so on to declare an ari we can use square brackets and two separate element use comma. So let's create Inari with a different type of data to create Addy. We'll just say Constant. A one is equal to and in the square bracket. Specify one. Mama do Garma. Three. Gomaa for Mama Fight two. Separate each element we use comma on toe end. The statement reels semicolon at the end. Now let's get at it with the different data fight, so we'll create a constant e. Do is equal to on in the square bracket with space. If I he's basically I won Mama do Mama No Guam. A full mama fight. So this is a string fight. Now we have a different type of data in the eight to Anne. Now let's take one more example off adding, So it's basically a string value in the area element, so we'll just say Constant 83 is equal to Hello, Mom. Mom was Mama Daddy. So in the third example we have added the string value, then we also have an addi containing addict. So to create that just create Const. A. Four is equal to on in the square bracket. We'll just basic fly one more Dari. So in the first index, we specify square bracket and specified the values one mama do coma three on two. Separate the element MySpace ified coma here, and then we create a first index value in the square bracket. So just say, for Obama five comma six. So now we have Ari containing area, right? So now if you wanted to check how many elements are there in the Ari, then their space. If I ari and called the land matter, this method will return the number off element in the area. Now let's talk about how to access this area value. As I said, Addy start from zero. So in the first example, the index off 10 index off. Second, he's one index off three is to and so on. So to get the value, we will just right Ari name on it in the square bracket space. If I index value, so here I will specify zero. So now you will get zero index value on the console. If you specify one in the index, you'll get the one index value on the console. Now let's change the area element to change the area element specify index value and specify your new value, it will automatically update itself. Now let's talk about the new topic So they are represent the date on time using date object date object Used to get a date Are you can use to set a date for particular event and you can also specify time using the culture to create a date object. Well right, Const Now is equal to New Date and Spacey five parentis is and close the statement with semicolon to bring current date will specify now in the council. So here is your current date. Now on the console you will get the current eight Let me show you how to space If I date to the particular identifying So we will just say const dd is equal. Do you date on in the parentis is we specify the year 2018 to separate the ear on month reuse comma. Then we specified the month nine drama on We specified the date hurting. Now when you print the DT constant, you will get the date and you can also specify times with the date object. So after the date well, just comma here on specified. 15 mama zero. It means 15 0 Zito. There is a different type of metal off date object where you can get current date month here, dying second on a song. Now let's move to the next topic. Regular expressions. Regular expressions is sub language off JavaScript, and it is used to perform complex search and replace operations on string. Regular expression is a big topic for explanation. It is beyond the lecture. We will cover the regular expression in the separate lecture, but just for now, keep in mind. Regular expression is used to perform complex search and replace operations. Let's move and talk about what is maps and said in this topic. Will cover math and weak map on Sit on 68 in new it musket six. A new data type introduced these map on sick and their counterparts Week map on week say maps are just like object, but it is offer more at 1 10 years than object in certain situations. States are similar to carry, except they can't content duplicate element. Now let's take a look how to create a map so we will just type God's don't rules. Is he called to new Mac and specify parentis is because it is object to call object the space if I parentis is on space. If I semicolon at the end using map, you can assign a particular role to the user using set maker. You can specify Key and Val appear to the map object just like this rules, Dark said on the parent pieces respected by the one foma user. One. We'll create one more user, so I'll just say Rolled Dark Set in the parent is is his base of I t to Mama user. If you're not understanding this toppy, then don't worry. We'll take a break. Look on this topic in the subsequent lectures. Now let's take a look. How to create a set in Jascha Say it's just a collection of data where duplicate are not allowed to space. If I roll to the particular user, you can use set to create a safe type. CONST. Draws is equal to new said on Special five Parentis is and end statement with the same equipment. Now using the admit er, you can add a specific role to the user, so just say it holds dot on on in the parent disease specified. User. If you take the state object, then you will see the user added in that object anything. This is just a basic off map and sits. If you don't understand this topic, then don't worry. We'll cover everything in detail in the future lectures. Now I think all these five topics are completed. Well, move over in the next lecture. 7. JavaScript Tutorials Serious Part 06: in this lecture, we'll take a closer look at string. As I said in the previous lecture, String is a big topic to describe, so that is why we created a separate video for strength. So let's talk about what its strength string just a simple takes. Data. You can also say string is a collection off characters. Numbers on symbols in the JavaScript string represent unique gold text. If you think, then this will definitely comes in your mind. What is a Unicode? Unique cortex is a computing industrial standard for the presenting. Takes data unique Court store later on characters By assigning a number off into one, I will show you how to create unique or in jail asleep after a few minutes. But first, let's take a look what he's escaping. So you probably know that creating a string or to create a literal offspring, we need to specify single or double coats. What if I want to add a single court to space? If I apostrophe in my string when I use apple stroppy in my string, it will terminate string lead troops. Let's take an example if I say let str is the quote too in the single court. We'll say reef, Duke Bank from him, Mama, he said. In the double coat, we say This is my back on and the state went with semi column Let's 2nd 1 more example Flit str one is equal to and the double court we will say Don't Dutch my back and in the statement with Chemical should the both literal are correct because the string it's set up with the single court in the first example on the double court. In the second example, what if I want to add both at the same time? If I say let str hitter Isaac will do and in the double court we will se ri duke bag from him. Mama on, he said. Now we put double court here and say Don't so a space if I don't on specify apostrophe here . 40. Touch my back So this statement produce an error message because at the same time we used single and double court for the string literal. So that is why the JavaScript doesn't know where to set off the street. That's all this problem we have escaping. I really right down the previous example again without any air. So we will just say Let str physical to and in the double court is basic by the book bag prom team Mama on, he said. So now, to specify single and double court in the string, Lee drove. We have a back flesh, so to say back flash double coat don't back flesh Single court e touch my bank Backslash double court on in the statement with that same column. So this example doesn't create any error message because we had used escaping here. The backslash not really used for the quotation marks, but also it can be used for non printable characters. Following is a street litter commonly used for special characters so back flesh and used to display text in the new line. Backslash are used for carriage done backslash d For that backslash single coat is far single. Court max. Last double coat is for a couple coats. Back slash back tick use for back to so this is new in the week mascot. Six. There is a one more special character. New in the musket, which is dollar sign toe are back flesh. We have a double back slashes and the final is we have Ah, back flesh You on the four ex us for represent unique core characters where four x represent Hegseth visible value off particular character. Now we will take a look how to add a unique code in the string literal on I will also show you how to concurred in its strengths. So we will first create a variable called 10 is equal toe 20.5. After that we created one more variable off str Cat is equal to and in the double court we specify whether off India he's and two concurrent a drink We have a plus sign So I would just add a plus sign just after the double coat and specify my temperature here. So I will say attempt Plus you can card in +81 more string We are close here and in the double court we add a degrees involved So this is unique court to add a legless involved to your strength. So I would just say it back flesh you 00 b zero sick So this unique court will are digress involved in your strength in Moscow six there is a one way to concurred in it to strength using string temperate, also known as a string interpolation. So to do the same thing in the musket six. Instead, off using double court were using a back kick to concurred. Innate strength. So we have the same example here, but I would just 80 the legal, so I would just put a literal in the back on to call variable in the literal. I really yields a dollar sign on opening and closing curly visits in that curly braces. Specify your variable name, which you wanted to display in your strength and then specify your unique court. So this is as simple as that. You are free to choose your own way to write the sting literal. What if you wanted to print your strangely true in the new line? Suppose you have a string on the demeaning string off your literal You want to register. That's ring in the new line. What will you do? So we have two metres to display strength in the new line using special characters, so we will just right. Let this year is the quote, too. In the double court, specify one line backslash and second line and end the statement with Chemical, so this treatment will print string. Lee drove on two lines on the first line, you will see one line text on on the second line, you will see second line decks. Now let me show you the second method to use the same thing with the back deck. So I would just say let s hear is equal to I will add back, take here and specify one line enter to line. So when you print this statement you will get the same results on console. So it will get one line text on the first line on to line takes on the second line. So this is the way where you can insert the multi line string in your coat. Now there's one more interesting thing off singly drop when you play with the strain, literal, you will get confusing results. So if you say let result one is equal to five. Multiply by five off string type and you also have a second statement off like the result to it's because too fight plus five off string type. Then what is the result off the first fans? Second statement? Is it string our number and What is the output? Let me know in the comment. What is the output on? Type off this do statement? 8. JavaScript Tutorials Serious Part 07: in this tutorial, we'll take a look. Control statement in this tutorial will explore eight and l statement. So we will describe where to use band. What is the use off and l statement? So what is a panel statement? The if statement is the fundamental control statement that allow just give to make decision more precious. If and l statement allow us to choose conditional choices you can use. If an else statement really wanted to execute a statement on condition, let me for show you the syntax off Peeps and l statement. If statement has two forms, the Post mom is eight in the parent cases, with specified expressions followed by the statement. Right First, we just need to specify if giver to start the control statement and then in the parent disease specified expression. So what is expressions? Expression is a condition. It may be true or calls in the expression. You just need to specify your condition, which is either to our faults, the same way used for second form also. But here we specify to statement for the condition. So the second form is eight. The parent species with specify expression, followed by statement one then we specify else keyboard followed by the second statement. Now, in the second bomb, we specified true statement for the it expressions. So the if statement will execute the four statement. If the condition is equivalent to prove otherwise, the else keyword will execute default statement. So if the expression is equal to Paul's, than the second statement will execute are if the condition is equal to true than the first statement it will execute. Let's take an example off first and second bomb off the statements. So in this example I will show you how to greet people using program. So I'm just saying licked Time is equal Toe nine on end the statement with semicolon. So we created a variable time here and specify nine really got variable. Then we create a statement on in the parent species. We specify expression, so I will just specified time The name of my Vidia ble. He's less then well followed by a statement and in the statement we specify console dot log and print. Good morning. When you run the statement, you will get good morning on the console in the if expression with space. If I if time is less than grill. Then we execute the good morning message on console. So the if statement will post checks the condition in the expressions on return through. If the time value is less than thrilled, otherwise even didn't floats. So if we just change the time value to 15 to the 15 minutes 3 p.m. then what is the result ? He will not get anything on the console because we did not specify any message for the full statement. If you're spacing 5 15 to the time variable, then the expression is equal toe false. So the condition is false. So here we specify a second form off a statement where we just use l's on space if I our second statement. So we just wanted to have the else give it here just after the statement and space. If I our second statement, I will just say console dot lock and specifying good afternoon message. Now many execute this statement. You'll get good afternoon on the console because the condition is equal to false. So the if statement will keep the first statement and execute false statement. We always base if I fall statement in the else lock on true statement in the If If you want to space. If I more than one statement, then you can use a block statement sometimes called compound statement. Using the compound statement, you can specify more than two statement in the block compound statement in just the city's off statement, enclosed in the curly braces that is treated by the JavaScript as a single unit to insert more than well, statement press if I curly braces, so to specify a curly braces just after the expression express. If I open, Collaborates is on just before the else statement specified closing curly braces. Now, in this curly braces will specify statement. So I would just insert console dot lock and we space fire message. Welcome to delegate Yushin. So this compound statement execute to a statement so it will create Good morning on Welcome to destitution on control. You can also make necessary on l statement using compound statement. So I will just say let time is equal to nine on in the expression on specified time is less than well then I will just remove the welcome message on here. I will see if and then Spacey fire pattern pieces on space If I expression time is equal to nine. Then I relied curly braces on in this girl liberation block. I would say console about law and basic by a message. The fine is to take your break for us, right? So when you run this statement, this will bring to message on the control. Good morning on the time is to take your break parts. So when the second nested condition is equal to true, then the message will print on the console. If the nested condition is false, then you will not get any message under control. So you can also put a statement in the nested if conditions and you can also put your mr if conditions in the else statement block also Now I just want to show you how to create a ladder using the S and l statement. So to create a ladder, we'll just say it's time is less than well, then we bring a message. Good morning, as was basic by one more condition here. So I would just say it in the Parenti sees. So time is less than 17. So the 17 means fight and now, using the calibrates is we create a compound statement on space. If i console dot knock on pretty good afternoon, massive and then we specify ill statement and bring good evening message. So now when you execute this program, you'll get a different output on different situation. So the if statement will first check the time is less than thrilled. If the statement is true, then the statement will execute Good morning Message on the consoles are If the statement is equal to false, then it will move to the else on check it. Time is less than 17. If the statement is true, then this will create good out a message on the control. If the statement is also false, then the state may be executed on bring good evening on the console. So this is what the latter is all about. So I hope you understand the if and else control statement in the next lecture will move forward 9. JavaScript Tutorials Serious Part 08: now in this lecture, we'll talk about switch statement. If an else statement, allow us to specify one or true statement on the expression but using sweet statement, you can specify expression with the multiple statements support. If you wanted to specify four statement for a specific expressions, then you can do that. You drink sweet statement if you use if an else statement to execute more than four statement that you need to specify multiple expressions to institute more than Khost using Stretch statement, you can execute multiple statement with the single expression. Let's take an example of sweet state so we'll just say switch parent pieces. Specify expression every day in this block MySpace fight G's Give us value one on here we specify our first statement. So this statement executed when the desert offer expression matches really want and then the space. If I break giver, then it's pretty. If I kiss you on here was basic by statement. Do with the brakes Cuba. Then we also our case under three colon on a statement. Three with the break keyboard and then the Archies. You end. So the end stands for any number of runners. You can specify multiple statement if you want and then specified Break Keeper the last piece of fight before Gulen and specify the Deport statement. Here. Using the syntax, you can create multiple statement with a single expression. We start street statement. You didn't switch keyword as basic by expression in the parent places. Then we opened the compound statement using open and close current graces on in this love space. If I our first case on its valley JavaScript will evaluate expression on pick the case matches to that expressions. So the statement will execute one by one at the time on execute matches. Case statement on After that exit from the switch statement using break, you run stuff about this break Cotino, return on. Throw yours in the future victims. But just for now, keep in mind that break statement used to break the execution off state. You can specify number off and values in the case heats up on you. Now let's take the example off Sweet state. Suppose you have a question with four options, you need user input to select one of the four options. When the user select option, we display that option on the console This is very simple example Will understand. So if you have a question like which language you choose that have put off tens opposed job sick and white time hard to be on four SP darkness. And when the user selects one of the four options, then we display that selected option on the console. Right? So I'm gonna add late. Answer is equal to one and in the statement with chemical and then they start switch statement with the expression. So in the expression, specify the variable need answers and faced by carnivorous. So in that collaborative spaces are post one the statement. So now we display message on the console So I would write, consoled or not, and bring you have select job and after that I don't break the execution. Then you create case too On display message on the console You have lake fighter on break the execution, Then create case three and print the message you have selected be on a break, digs Duchamp using breaking. After that, we create port case on space. If I message in the console dark log with her and just say you have select is and then specie five break at the last space. If I deport execution, then colon and specify before message. So I would say console doctor, sorry, you Jews of long answer on a break. Now, when you execute this court, you will get the first statement on the console because we selected first option. Now if I change the answer, variable value and select sickening auction than the result would be second statement on the same kink work for the food and forth auctions. Also, it's different on your cases. We just specify four cases here. You can specify more than that, so switch statement is not limited for a specific program. You can use this concept to achieve the different house. Now what if I specify fight in the answer valuable. So switch statement. Execute depart block for those values which was not matches toe kisses. Now I also want to recover one more copy, which is Tallis. External fight. There is one more way to link your Jospin five year estimate when you're creating more than 100 lines off court that the court will be complicated. To solve this problem, you can create safer jobs we find to manage coat so to create a new file of JavaScript. Just click on this icon on space. If I your name on its extension To recognize the Jospin file, you need to specify Dark Days extension to the JavaScript file. So I would just create mean dot to his file here. After that, you need to link just fine to html. You didn't escape back. So like this file, both We are female on space. If I skip back in the escape back in so, so sad Reboot on space for your absolute part off. Now your child is lead. Here is the movement. Now I'm just copy this program on interested in the job. The program is working fine. Separate in your JavaScript court from the stable document will help you to organize your core property. 10. JavaScript Tutorials Serious Part 09: In this lecture, we will talk about what is. Look, let me first describe what is loping means. Flipping is a sequence off instruction that is continuously reported until the certain condition is met. In simple words, looping is a continuous task that happened until the condition is troops. When the condition is become false, then the looping terminated. The JavaScript has four looping statements while do while for and for in one common use off Luke, is it read or the element in the area. We will discuss R E and advance looping in the future. Tutorials in this lecture will discuss. So let me first show you this intact off by look. So the syntax off while loop is while in the parent cases you specify expression and just after that, the statement. So first JavaScript will evaluate expression. If the value off the expression is true, then it will print the statement until the value off the expression is become false. On the other hand, if JavaScript returned faults, then JavaScript skipped the statement and execute Ray stop the cold in simple words. Why look only executed when the expression returns? True, if the value off expressions written falls, then the via loop terminated to wrap multiple statement. In the white loop, you can use compound statement using open and closing curly braces. So let's take an example and understand how. Why? Look works. So in this example, we print 0 to 9 and numbers on console, so we create a variable. Let count it's equal to zero on. Then we create a wild look, using while keyboard and in the parent basis with specified expression. So I will just say Count. He's placed that Dan. Then I'm specified. Carly braces on in this curly braces. Specify console dot lock and print count rally. After that, I would say Count last plus on your semi colon to end the statement. As you can see, we created a very well count on space if I value zero to that variable, then recreated while loop on in. The expression with specified count value is less than 10. Then we wanted to print the count value on console to print count brand you were using console dot log mattered and to increase account value by one we used account plus plus shorthand operator. We'll take a brief look at operators in subsequent lectures. But just for now to increase account value by one we use plus plus sign. You can do the same thing with this court also, so we'll just say count is equal to don't plus one. Both statement are equal, but choosing a minimum court will always help you to maximize your performance. So when you execute this statement, you'll get 0 to 9 numbers on console. But how did this happen? So the expression will first check The count is less than 10. If it is true, then we brained count value on the console so the JavaScript print zero on the console. Because zero is less than then, then the next statement will increase the value off count variable by one on. Now the local will goes on the top again. Then it will take the expression again with the new variable value, so it will take one. He's less than pen or not, and if the expression returned true, then it will bring the count value on the console and again increased the value off count variable by one. So the JavaScript will do the same thing over and or and bring 0 to 9 numbers on the console. But how did the loop dominated? When the count variable value is equal to train, then the expression become false because time is not less than 10 So the expression returns falls on. JavaScript escaped the compound statement on Finally, terminate the look. You can put multiple statement on complex expression in the Via loop. It's upon you how you can use the way I look. So that's it. In the next lecture will explore, Dubai looked. 11. JavaScript Tutorials Serious Part 10: in this lecture, we'll take a look at second looping statement, which is dual lope. No one loves it just like a via loop, but accept that the loop expression is a tested at the bottom off the loop rather than at the top. The first declare do section and then specify vile with expression. It means that the body off the loop is always executed at least once using Dover Loeb, be forced, execute the statement and evaluate expression. John Skip. Execute the program from top to bottom. That is why it will first execute the dough statement and then evaluate expression. So following is the syntax off Dover doh, then statement followed by violence with expression. And after that, don't forget toe foot, semi colon. Just after the closing parentis is you can put multiple statement in the do block with compound statement using curly braces. Occasionally you have a certain situation where you need to execute statement at least once at that time, Do I look is very helpful. So let's take an example off Dubai look, so we'll create a variable using Let gown is equal to zero. Then we start. Do overlook using do keyword with compound statement. So I will specify curly braces here and then toe friend value on the console we use console dot No and put count value strength and to concurred in it count value reused plus sign space. If I count variable here just after that, we will increase the count Variable value using plus plus sign and then at the bottom with space If I while and in the expression we will specify account is less than fight on space If I semicolon at the end now, in this example, we are printing count value on the console using console dot log maker using concatenation we concurred in a string and count value together and after that we increased the count value by one using plus plus shorthand operator And then after the compound statement closed, we will specify vile with the expression in this expression, we'll check count. Value is less than five or not. So now let me first execute this statement and show you the output under console you will get count value from 0 to 4. So the Dubai look first execute do block and then moved with the vile expression. Then the Dover loop E valued expression on. If we get true value, then the execution will move at the top and execute do block again. So the door I love to do the same thing again and again. Still, the value off expression will become false. When the expression returns false. Then the loop terminated. So that is why when the value off count variable become five, the expression will take that five is less than five or not. As you know, five is not less than five. Five is equal to fight. So the expression Dickens falls on the loop will terminate it. Now you will be think this is the same as right loop, isn't it? It is not know why Lope worked like a via loop. But there is a one difference in Dubai. Look as I said. Do I love execute at least once? So if I change the expression on Jake If count value is less than zero then what would be the output? Let's see, When you execute this court, you will get count value zero on the console. So do we Look, execute, do block first and evaluate expression. So, in the expiration, we already specified false condition, so the expression will returns falls on determinate. The look that simple is that you can do the complex things in the Dover loop with the use off. If an air statements that is upon you, have you put different things together? If you are following us from the first part off the jazz cap pictorial cities, then it would be very easy to understand all these topics. That is all for this lecture. We will see you in the next tutorial. 12. JavaScript Tutorials Serious Part 11: well in this lecture we will talk about for Look for Low is often very convenient than well , look, because off its structure for look is very easy to construct. Inviolable on Doughboy, Luke has a common pattern off initialization expression. On statement, we first initialize the variable and then evaluate expression on execute statements the same way for local so executed. But there is one difference in for Lou is you can initialize variable on. Also specify expression on increment and disagreement. Variable value on the one line. So let's understand for low using syntax. So the syntax off for loof start from far and in the parent disease. Real post race If I in this location semi colon expression, semi colon and then sprays if I implement argument operator after that face. If I your statement, we will start for low using for cover on in the parent pieces with specify initialization expression and implement our document operator. So we'll first in. It's like the variable with the value and specify semi colon after in this logician. After that will specify expression and specify semicolon at the end off the expression on, then specify inclement and document after that reels base. If I our statement which we wanted to execute. If the value off the expression is true, then the statement will execute it. Keep in mind that every loop execute its statement. Only eat the value off expression returns true. Otherwise the execution off the local will terminated. You think the example You will get complete understanding off for Luke. So let's take an example. So we will train 0 to 4 number on the console using for look. So he's basically I far in the parent cases before initialized the variable, so I wouldn't say leg count is equal to zero. Then specify semicolon. Don't forget to specify semi colon after each expression. Right then, it's basically account is less than five semi colon and then specify implement or document operator. So I would say count plus Plus, I'm using inclement operator here. Just after that, I was specifying my statement. So I would say console dot log on in the parent thesis. I will specify number in the double gold and can coordinate count value Right now, The important thing is don't forget to specify semi colon before and after the expression. Now, when you execute this example, you will get 0 to 4 number on the console. Looping is executed just like a violin. But we just any slice a variable. Specify condition on increased the count value on the single line. The difference between why and for Luke is structure right. Let me first explain how for look works. When you specify part loaf, it will first create a variable count and space. If I value zero to that variable. After that, it will check if the value off count variable is less than five or not. If it is returning to then the body off the statement is executed, so you will get zero on the console. After that, follow will increase the size off the variable using increment or detriment operator, we had used increment operators, so the value off the count variables will increase by one. So now you have one in the count variable, so the four loop will go at the top and again evaluate expression with the new count value , so it will check if one is less than five or not. If the expression returns true, then the body off the statement is executed and implement the value off the count readable again. So the for loop execute the same pattern again and again till the expression off the for loop become false. So when the value off the count variable become five, the expression village turns Fox because five is not less than fine, right? So let me first explain the steps off execution pattern First for Luke will initialize variable with its value. 2nd 4 loaf will evaluate expression before moving to the statement. If the expression is false, then for Luke been terminated. If expression returns truth than the far look follow doorstep. Third Farlow Pill Execute statement. In the third step, you can also use compound statement to execute multiple statement one by one, and the fourth and the last is a for loop will increase or decrease the value off the variable by one using increments and Dick Limit Operator. After that for look will go at the top again and skip the initialization step. Because we already initialized the variable so far, Luke will move to the next step and evaluate expression. Then it will move to the third step and then moved to the footstep so it will evaluate expression, then execute statement on. Then increase the value off the convertible so the four low follow the execution pattern. It immediately kill. The expression returns false. You can specify multiple variables. Also in the initialization. Step on. Also specify multiple expression on implement and equipment operators, for example. Now we have multiple variables, so we'll say far Let I is equal to zero. Mama J is equal to fight as specify Semi Colon. Then we specified conditions. I is less than five and face if I I plus plus drama J minus miners. So we use increment and document operator at the same time and in the compound statement with specified console not law to print I and available value. I was basically I I plus in the double court was arrested by anger and to con card in eight j value of unspecified plus year on space if I gave it evil now, in this example, we declared two variables I and J and specified zero and five value after that. Will Jake, if I is less than five or not, If this expression return true, then shrivel. Execute console dot long metal and print I variable value and J variable value on the console. You can also see we use increments and agreement operator toe I and J variable. So when you execute this course, you will get 0 to 4 number value off the I variable on 5 to 1 value off J variable under consult. So we had increased the value off the variable I onda decreasing value off the variable J right, That's it. We completed our for low. Now in the next tutorial will explore nested for loops. Lester, for look is very helpful for accessing multi dimensional area later. I hope you understand the basic concept behind the for look. That is all for now. We will see you in the next lecture. 13. JavaScript Tutorials Serious Part 12: in this lecture, we'll learn how to create a nested for low in JavaScript. So nested for loops is just a for loop inside for look listed for love usedto access the dynamic area element. Or you can also use these for creating different patterns on for metrics manipulation. There are multiple ways to use nested for loops in your program, but we're using the nested for loops for dynamic Eric. Taking this lecture will help you to understand how nested for loops bulls on how you can use thes for dynamic Eric. So let's create an example, and after that I will explain everything in detail. So now here, I just wanted to say for in the parent cases, I was specified. Let I is equal to one Then I was basically I expression, so I would say Hi is less than four. Then I will increase the value off the irremediable. It's basically compound statement on here. MySpace. If I have one more inner for loop started, say, for Let Gay is equal to one game in less than poor on a key last for us now here I will print I N k value, so I will say control dot law on here for specified. I've able drink either given around the post, then specify comma two separate I and give value right space if I give it over here. So when these four look executed, I will print I variable on the new life. So I wouldn't say console Doc Law on, specify a special character slash And so this will print a character on the new line. Right now, let me show you. What is the output off this cold are just a horrendous cold, Right? You will get this output on your console, but it is really weird. So let me explain how this output came out. So first outer for loop executed and specify one toe the i variable. Then it will Jake I is less than four or not. If the expression returns to then the body off, the statement will execute. So the I is less than four. So the inner loop will execute right in the inner loop. So we declare a k variable with the value one. And Jake Gay is less than four or not. So if the value off the K variable is less than four, then this expression returns true on execute console dot Knock statement. So now you have one value on the key variable, so the expression will returns to execute the console. Dark matter Let me explain how it's for real are comment here. Now you have ivy able on the available contained value one night. So first the outer for loop will evaluate the expression and execute the body. So in the body we have one more for low So we declare k variable here I will just say OK, so now the cave evil is equal to one So I would say k equals one right? So ran the inner loop Execute It will break one and one value on the console Right? So I is equal to one on K is equal to one So you will get one for my one on the console. After that, the value off the K variable will increase on execute inner for loop again And now the value off the cave in vivo became too on You will get one and two on the console. After that, the increment operator will increase the size off the K variable Bible. So now you have three in the K variable. So now three is less than four, so it will return true and execute Console dot log mattered. So you have a one in the I variable and three. So we'll get one and three on the console right now. The incremental operator increased the size off the K variable by one. Now you have four in the game irritable. So now it will check if K is less than poor or not. So it means it will. Jake four is less than poor or not. So the expression returns, falls and skip this console dot log methods. After that, it will bring console dark lock on the console right here They will get a new line or here After that, the implementer operator will increase the size off a variable. Right? So now you have to in the I variable, right? It will check. I is less than poor or not. So if I means to is less than four, then this will execute before look again. So now this will returns true and execute this for look again. So you will get to under control and print 123 again. So this low, we'll execute three time again, Right? So now you have one in the gay variable and two in the I variable. So you will get two and one on the control right after that, the K plus plus operator will increase the size off the gay variable and K became too on, then thes for low evaluating this expression and check if K is less than four or not. Now this statement returned to and execute console dot love metal again so you'll get two and two on the console. This will increase the size off the K video again on the key value is equal to three. So now you have a three in the cave variables and this will Jake three is lives and four, it will return through on execute the console door clock and you will get toe entry under console All right after that. But given our new become full and it will, Jake gay is less than poor or not. So now four is less than poor or not. It will. It turns, falls and escape this console dot log method on execute this console dark apartment, right. They will get this line on the console. After that, I will become three. So this statement will increase the value off the I variable by one. So the value of the eye valuable become three on chek expression. This expression check three is less than poor or not. So now this expression returns true. Executed for low again But this for look executed three times she will get 123 on the control with the I value. So now you have three in the eye variables. You will get 33 d on the console on the value off the gay variable, which is 123 So when this for Luke dominated, consoled outlaw mental will execute through get a new line over here on the value off the I variable became four. So now you have a poor in the i variable, so it will check I is less than four or not. So it will. Jake before is less than four or not. It will return false. So when the expression returned falls So the outer look will terminate and exit from the loop. So you will get in this output on the console. So that is why you will get this type of output on the console. That's it. I hope you understand in a strict for long enough. 14. JavaScript Tutorials Serious Part 13: In this tutorial, we will discuss foreign dope before you moving on to the fore in Loop. I personally recommend that must watch for local Theriot because foreign lope is depend on for look, and it's very easy to understand foreign. Look in this lecture to create a for in loop. We have a syntax far, and in the parent cases I was faced by variable Dean object. Just after that, I was basic FYI statement. As you can see, the same tax is very simple. We start foreign look with the four Cheever and declare a variable using let giver. Just after that, we specify in gabled with an object. So here object it just expression that evaluate to an object. Then we specify statement our statements block. So as a body of the loop, using example, you'll completely understand how far works except explaining the syntax. I will explain example in detail. Foreign look only works on object data type. Keep that into your account. Right support. You have object with some key and fell appear so here in this example, declare constant object or B J is equal to in the curly braces specified key and repair service place five a colon, one comma space. If I a second property, be Poland to I'm a C corland three and then the last property de colon for on Spaces by cynical and at the end, Just after that, I will call my for Indo using for Cuba. In the filing cases, I will say Let oh in object. Just after that, I'll specify component statement using Carl embraces and just, say, consoled out log method to print object properties and say O b j. And in the square bracket, I will say Oh, right. So when you execute this example, you will get 123 and four on the console. We had already learned what is object on how to declare. So in this example, we declare object with some values and peers to access object property. You need to specify particular key to access that values. What if you don't know the key on you have multiple key and here in the object property, then what will you do? And again, what if you wanted to access all the properties in the object on display them on the console? I know you're not insane to display each object property using G right. In that situation, you have a part in lope to rescue. Using foreign look, we eat rate each object property one by one. Using foreign look, You can display each object property on its value on the console. So first we declare a variable and specify in keyword just after that and then specify our object. So the four nope will first evaluate the object and start the loop execution. So the loop start from the first index on end with the last index value in the O variable. Foreign lope will insert each key one by one, just like for Luke are variable, which increase its value by one using incremental operators on execute with statement. So first foreign lope Evaluate objects and execute the statement with the first key. So first, we have a value in the o variable. After that. For Luke, execute its statement and print specified value off the key. After that, foreign loop will move at the top and take the second key, which is B and then execute statement with the specified value off the key. So foreign loop execute the same pattern again and again and print each property off the object on the console. Then the lobe will terminate. Far Loop is not limited to print object properties on the control, but also you can print at Element on. Also, although Object data, which is evaluate toe an object you're not. Just print the value off the properties, but you can print the key also. So just change the console dot lock and remote object from the console method and just specify available. When you execute this court, you will get all the keys in the object on the console. We're using Foreign Loop in arid tutorial also, so in the subsequent tutorials, you'll completely understand how to use foreign. Look in your program. Experiment with this tutorial on Understand How Far in Luke books, I hope you understand foreign look. 15. JavaScript Tutorials Serious Part 14: in this lecture will talk about far off In the previous few lectures, we learn four typo loops, but there is one more look at it in the musket six, which is far off in latest version off JavaScript, we have five tights off loops. My loop. Do I knew for new for include on foreign off loop. Now, in this lecture, we will learn for off far off. Look, it's just like a for in loop. But this only works on interval object. Borrow flu is new Edict Manuscripts six on for a fluke. Going other way to look over the element in the collection For a loop. Generally used toe trade over an addi an object fight every my say it string on other drivel objects. Following is this intact off far off Luke so far off loop stocked the bar keyword with the fantasies and space. If I variable with off, you weren't and the object and then we specified the statement, which we wanted to execute. The far off Luke can be used on adding, but more generally you can use it on any object that is terrible. So now here is the example off far off Luke, so we'll start with the Ari. So declare Harry, Don't say left. They are rife, which is it's equal to on in the square bracket. I would say one want to for my three from a full on com, a pipe. So we have five elements in the area, then really clear for blew apart on in the fantasy, I would say Let value all Addy in the compound statement. I will say console dark law and print value So I will speak to buy value, read a book. So when you execute the statement, you will get 12345 on the console for a look will look over each and liniment and bring under control, as I said for work like a foreign dope. But there's little difference between far off look and foreign supposed. If I have changed the far off look into foreign look than what will be the output. So the output is 01234 so foreign look will not bring the element on the console. Instead, veteran trained index number off so that our food you are seeing right now is index number , often an element I will just change these foreign loop in foreign off, right. Using far off Luke, you can also bring strange characters. So suppose you have a sting solution, so I will declare a stream here late Basic will do the double golden in a statement. Now you know, just basic by the stream in the party I just remove the Addy object on space. If I the string here when you execute this court far off loop will separate each character and print on the console. As I said before, string is just a collection off characters so far, Luke will just bring that character on the console. Just simple as that. For a blue is the best choice when you don't know the index number often. But if you know the index number off the ari, then you can use far new puzzle. The difference between far in dope on for upload is for in Luke, Luke or innumerable properties and far off loop does use and a treble object on new power generated values. So the benefits are far off. Luke is you can change the in terrible element. So you think far off hope you will get the index value on the control, not the index number. Support increased the value off the other intimate by one. When you execute the statement, you will get a different out. Now, in this object, you'll see one is adding in the element, so this will increase the value off the area. Element 51 using for loop If you know the concept off for look than this topic will not really hard to understand. That's it. I hope you understand part off Luke. 16. JavaScript Tutorials Serious Part 15: in this lecture, we will talk about expressions. We have used expressions many times. Still now. So in this lecture will describe what these expressions so expression is just a statement that even late toe a value in simple words. Your school expression, devalued to produce a value variable is also an expression that even earlier toe whatever value has been assigned to that variable. So the most common way to build complex expression is with an operator. We will talk about operator in the next tutorial, but for now, let's take a look at the primary expressions. So what is privately expression? The simple expression is also known as primary expression, so primary expression in JavaScript is constant. Our little values. It can be variable reference or certain language reserve keyboards. You already know that little are just a constant value that are embedded in the program directly there. Look like this. So I would just say five, firing 30. So this is a normal literal on. You can also say daily here, this is a string leader, and some of the JavaScript reserve words are also expressions just like no, true on false and finally the third type of JavaScript. Expression is a rare variable. It will be looked like this. A steer just a valuable devalued toe, a value off the valuable last year. Undefined. It is a global variable, not a P would like. No. So not only is the key word on undefined is a global variable space. If I identify in the expression JavaScript assumed, identify as a valuable on look up its value. If no reliable found are no value exists, then JavaScript, even Luit toe undefined value. Now let's take an example and understand expressions. So I would just create an example here and I will declare a variable. So I wouldn't say Let why, Then, on the second line, I will say Why is equal to four? Multiply by five and space? If I say McQuillan at the end, and to print this value, I will say consoled, outlaw on, specify why reliable here. So these expression this so the number. When you execute this cold, you'll get 20 on the console. Now let's take a look at the common operation in expressions, which is multiplication. It makes sense that multiplication is an expression. When you multiplied to Oprah, you'll get the result. Now, in this example, the first line will declare available. Why? So the more interesting thing is that there is to combine expressions on the second line. We first multiply two numbers and result toe the value 20. And then there is an assignment operator that assigned the value 22 the variable fight. So if I just declare one more variable here and assign it to y very well, So then it will look like this. So I would just add available here. So I will just specify comma and specified Jake. Now I will assign the vibe Variable value Tojo variable. So I would just say here Jay equals do white right now. Let me explain this example. So now here, multiplication and assignment both are expressions. When you execute this statement, Joseph will first solve multiplication expression and assign 20 value readable Why? But still, when you print variable J, you'll get undefined value when JavaScript specify variable 20 value toe y variable. Just after that assignment, expression will assign 20 value through the variable jay. So the execution process done one after another right when you're using operator, just like multiplication. Our assignment are known as operator expressions when you're using any operator in expression than this expression known as operator expressions. In this example, multiplication consists off for multiplication operator, which is a street sign and add toe prints off France means that the number you are trying to multiply so here four and five easier. Oprah on a straight is your operator, but there is to expression that are not operator expressions identify expressions on a literal expressions. A variable and a constant is itself at expressions along with that literally is also itself and expressions. So, in short, everything that result in the value is an expressions right. 17. JavaScript Tutorials Serious Part 16: in this lecture, we'll start a new topic. Operator Operator is very important topic to understand because using operator you can solve many problems and you can create amazing things. In the previous video, we learn what is expression is all about now in this lecture will take a look at operate owes. We mostly used Operator to specify our efficient because using operators you can compare to values you can add, multiply, divide and do so many things. Now the question is, what is operator in simple words? Operator is just the expression result in value operator. Take one or more open to produce a result. For example, in this example, I won't say one plus do now. Here one and do is LeBron and Blow Sign is operator in programming language. You often see Oprah called argument, so we'll start our operators from the basic mathematics, so we'll discuss arithmetic operator first as long as I know you feel comfortable with automatic operator because you loan most off them in the school. Now let's take a look at the arithmetic operators. So first plus plus is used for addition on also for concatenation, for example, three plus two now the result would be Fight this operator Evaluate value right to left second subsection used for subtract values. For example, three minus do. The result would be what this operator evaluate value right to left next. The region division used to divide to values, for example, three. Divided by two. The result would be one point. Fight this operator evaluate value left to right then the next twenties. Multiplication multiplication used to multiply two values. For example, three multiplied by two. The result would be six. This operator evaluate value left to right. Next reminder Reminder returns reminder After division, for example, Dan Reminder three is equal to one. Then Reminder three. Let's that would be one. So three goes into 10 3 times on with one like lower this operator devalued value left to right. Next unity negation, for example. It is *** deal right. It means, if why is equal to 10 then minus white will be final. Stand this operator evaluate value right to left next unity. Plus it is blessed why It means if y is equal to minus them, then plus, why will be them? This operator evaluate value right to left next three in agreement. Three increments used to increment value by one on evaluate toe a new value so this operator evaluate value right to left. Then we have post increment. Also so post increment used to implement value by one but evaluate the value off by before increment. Right, So this operative devalued value right to collect. I will explain pre and post implement after a few minutes. Then we have read equipment operator. Also, we use three D gaming operators to decrease value by one on evaluate toe a new value So this operator evaluate value right to elect boast a agreement post equipment used to decrease value by one and evaluate the value off why before the agreement. So this operator evaluate value right toe left. So this is a pragmatic operators. Now let's take an example off pre and post inclement. If I declare two variables here, let J. Mama X is equal to fight. Then I just wantedto specify pre inclement operator. So I just said Jay Peak would do plus plus X specified pre increment operator and just bring the J value on the console. So when you execute the statement, then what will be the result, the result will be six. Because when javascript assign value to the J variable, it will first increase the value off X variable by one and then space. If I toe the JV ever for you will get 600 console. What if I specify post increment here? So I will just space if I post increment here. So what is that? Is that count So there isn't will be fight. When you execute this statement, JavaScript will specify rally, explode, available, Jay and then print on the console. If I just specified these statement again, I'll just say J is equal toe X plus plus. Then the result would be different. When you execute this statement again, you will get six on the control. So Joe escaped. Will increase the value off the Xperia bill by one on specified toe the JV label and you will get 600 console The same method applied to the detriment operator also right, That's it. Now our arithmetic operator is completed. In the next tutorial, we will move forward and learn more operators. That is all for now. We will see you in the next tutorial 18. JavaScript Tutorials Serious Part 17: now in this lecture, we'll take a look at competitive operator, as the name implies compares an operator compared to different values. Broadly speaking, there are three type of comparison. Operator. Strict equality. Abstracting reality on relational equality. We'll take a look at all these three times in the next tutorial, but now just take a look. How competitive operator looks like. So the following is the comprising operator to compare two different values. First place, then operator less than operator evenly toe through its first Oprah is late, then it's the second okra. Otherwise, it even lead to false less than operators evenly toe value. Let too right. For example, if I declare two variables here, let X is equal to five. Mama, why is equal to 10? Then? I would just bring these values on the console so I would say control about law. And in the parent cases, I will say X is less than why. Now. What will be the result? The result would be true because X means five is less than white. It means then fight his less than 10. That is right. The result would be do next gooder than a breeder. Better than operator evaluates to True. If it's first, LeBron is greater than its second Oprah. Otherwise, it devalued. Do false better than operator evil, your toe value left to right, for example, you're using the same variable for this example also. So I will just use console dot love to print values on the console trail, say controlled, outlaw and in the parent cases, and specify X is greater than white. So now that is, that would be problems because X is less then why it means fight is not later than then. That is why the result would be false. If I just swept these values that the result would be different. If I just say why is greater than eggs, then the result would be true because then he's greater than fight. That is why the result would be true. Don't be confused between less than and greater than operator. OK, keep that in your account. How to detail greater than on how to declare less than operator next, less than or equal to less than or equal to operator evenly toe group. If it's first, Oprah is less than or equal to its second grand. Otherwise, it evaluates to false, less than or equal to even newt toe values left to right. For example, if I just say control dot now on in the patent cases, haven't specified X is less than equal to why, then the little would be true because eggs means fight is less than then. It is not equal to 10 but it is less than 10. So that is why the result would be true if I just change the value off the wife. So I would just say five place if I five value here. So the result would be true because five is not less than fire. But fight is equal to fight. That is right. The result would be true. And if I just change the value off the five and basic by three here, then there is That would be false. Why? Because X means five is less than three. No, that it will check again. X means five is equal to three. No, that is why the result would be false. Next greater than or equal do greater than or equal toe operator evaluated. True, If it's first off, Ron is greater than or equal toe its second Oprah. Otherwise, it evaluates to false, greater than or equal to operator even lose value. Let too, right. For example, I will just bring the message using console dot law and in the parent pieces of space. If I X is greater than and equal do. Why, then the reason would be false. Because X Men's five is not greater than 10 and ex Miss five is not equal to 10. That is why the result would be false. And if I just change the value off the Y variable and say five year, then the result would be true because five is not greater than five, but five easy calls to fight, so that is why there isn't would be true. And if I just change value on, just say three here, then what is the result? The leaders would be true because X means five is greater than three but not equal to treat . So the force value is true means X is greater than tree. That is why there isn't would be true. As simple as that, that's it. Now your comparison operator is completed. The next Vittorio I will describe three types off comparison operator. I hope you understand this lecture 19. JavaScript Tutorials Serious Part 18: in this lecture, we'll talk about a different type of comparison operator. In the previous video I described, there are three types off comparison operator Now in this lecture will take a closer look at comparison operator types. There are three types of comparison operator. Strict equality. Abstracting reality on Relational will start his tutorial from the strictly gravity, and after that, at the same time, we compare strict on abstract equality. So what is strictly Crowley when two values considered equal if they refer to the same object are they are the same type on have the same value? I personally coming you to use strict equality when you're comparing to values. We will also take a look at what is benefit off using streaky quality rather than abstract . To check stick equal devalues used three equal sign and to check, not sticky quality value. You can use exclamation mark on double equal sign right. We'll take example after a few minutes. But now let's go on to the next type abstract gravity. When do we values consider attract equal if they refer to the same object, are having the same value to check abstract gravity you can use double equal sign on to check, not abstract gravity. You can use exclamation mark with the equal sign. Now let's take an example off street on attracting gravity. So I'll just declared variables here. 1st 1 is the number, so let is equal to 10. Mama. Yes, there is equal do in the single goal, I will say then, so the first valuable is number and second variable is strength. Now are just bring it's value under control using control Dark law on In the parent cases, I will say X I will specified double equal sign here on specified this year. So this is abstract Kralik. So any execute this statement, then what would be the result drew on Fox? There is. That would be true because we use abstract gravity to compare two values. When you're using abstracting reality, it is very important to understand abstract equality only take it's Oprah values is equal or not. It does not. Jake, it's type, and when you convert these toe strict equality, then the result would be different and you will get falls on the council because when you comparing this value with the streaking gravity, X is not equal toe stare because it's tight. X is the number on Ischia. It's a strength. That is why the sticky gravity it don't for using strictly gravity operator. It will take its footprint value and its type. If both variable having the same type on value than strict equality say true abstracted gravity will just Jake value in the variable. So if you wanna use strictly gravity, you can convert strength into number like this. Just a console that in the Parenti sees I will say x his basic five strictly gravity operator on seeing number and in the parent disease, I will specify str readable. So when you execute this statement, the result would be true because X is now equal toe s stare because Esther is now converted into number, right? So this statement will convert string into number and the desert would be true because X and this year has the same values on also having the same type the same way you can compare not equal to value also using strict and abstract gravity. So I would just say console doctor and in the pattern pieces, every specify X is not equal to number and specify s staring. The parentis is so we're using not strict equality operator here. So there's only would be for the best way to compare two values is using stick. Kralik, strictly grantee will give you pure reason, right? Let's move on to the next topic. Relational relational operator is also used to compare toe values. In the previous video, we learned different type off relational operators. We describe all these operator in detail with example, right, That is all part now. I don't see you in the next tutorial. 20. JavaScript Tutorials Serious Part 19: in this tutorial, we'll take a look. Logical operator. There are three types of logical operator supported by JavaScript, which is, and far and not. So Let's start with the first operator and logical and operator used to perform Boolean operations on the two values. 80 tons to if and only if its first Oprah and its second open our truth cape one or both or Franz are false, then. Logical on operator. Three tons faults Logical and operator used as a conduction to join two relational expressions. So let's take an example and understand how an operator work every day. Fear two variables here, so I would just say Left X is equal to 10. Mama, why is equal to 10 right? So if I just wanted to check ex and why is equal to 10 are not I will use if condition here . So I will say if X is equal to pen. After that, I will use and operator here and then evaluate next expression. So I would say why is equal do? And in the first true block, I will say control dot law and print true message on the console using else I'm just brained falls on the console, right? If I execute this statement, it will return to because both relational expressions are true. X is equal to print. And why is also equal to 10 now if I just change any expression, even live to false that the if condition execute else block and return false? It means logical and operator returns. True, if both relational expressions returns true, if anyone returns false than the logical and operator evaluate to false, it means logical and operator returned to if and only if both expression evaluates to true . Right now, the next operator is far so logical or operator perform Boolean operations on two relational values. It will return true if one or both or Brandt evaluates to True. It means when both expression evaluates to false, then logical or operators returns false. Otherwise, it will return true for examples. If we use the previous declare very well, then I will just say if X is equal to bend and now I really use our operator here. And then we specified the second expression. So I will just say why is equal to then. Now in the true block, I will say console dot law and trained true message on the control onder using else block I will just bring falls on the console. When you execute this statement, you will get to on the console because both expressions have you done true. And if I just change any expression he valued to falls, then what would be the result? The result would be dropped because, in logical or operator return falls when both expression evaluated to funds. Otherwise, it will return true. So it means one expression e value to true and second evaluate to false, then the logical operator to turn to. And if both expression evaluate to false, then the logical operator return false. As simple as that, you are not limited to use two expressions. Only you can add multiple expressions off logical operators. Now the third and the last logical operator is not. The not operator is a little bit different than and in our operator. Not operator is a unity operator on it is placed before the single or print. The use of not operator is toe involved the Boolean expression. It means if X is equal to true, then using not operator, you can invert its value by just specifying not operator before the variable, you can just invert bullion value by just specifying not operator before the variable. So if I just say let there is equal to Drew and I will just bring this there on the console . So I will just say consoled, outlaw and print there on the console. So when you execute this statement, you'll get through on the console. What? Did I just space If I not operator before these air variable If we execute the statement again, then what would be the result? Yes, you're right. The result would be false because we inverted their variable value to false using, not operator you can use, not operator toe in vote Any expression anywhere, right? That's it. Our logical operator is completed. I hope you understand this lecture. 21. JavaScript Tutorials Serious Part 20: in this lecture will take a brief look at bit wise operator in the JavaScript. We have bit wise operator. Too many plate lonely will been everyday presentation off numbers. This operator is not commonly used in JavaScript programming, but you can take this tutorial as a knowledge. If you're not family or with China, BT presentation off, placing well in teacher. Then you can probably skip this video between operator works on only integer open and, as in this open as 30 to pick in creature rather than 64 bit floating point values. Now the following is the big voice operator, first bit wise and operator midwives and operator for form Boolean operation on each bait off its into your argument a bit is set in the results only if the corresponding bait is said in the both or print for examples. So we have two opens here with the exit visible value. When you execute this statement, the result would be this. So we specify for bait for the first Open and to bait for the second Oprah. Now the and operator returns only two rates as a result, because we equally said to bits on the open right now. The next big boys operator is part of the orbit Ways operator perform William operation on each beat off its indeed your argument a bit, it said in the result. If the corresponding bait is set in, the one are both off the Oprah, for example. We have to exert visible values with our operator, so the result would be this right. The next streetwise operator is Czar Zarb, streetwise operator. Perform a 1,000,000,000 exclusive Our operation on each bait off. Its indeed, your argument exclusive are means that either a brand one is true. Our opera to is true but not book, for example. So we have this example with his or operator. When you execute this, you'll get this executable value right. The next operator is not the not big boys operator is unity operator that operate by reversing all its big in the Oprah. For example, when you execute this, you will get this result ar minus 60 right? The next operator is shift left. The shoot left before his operator move all beat in its first Oprah, for example. In the operation, he then you specify the shift left operator on one now the first bait off a become the second beat. Then the second beat off a became the third beat, etcetera. Shifting a value left by one position is equivalent to multiplying by two. Shifting to position is equivalent to multiplying by four on so on. For example, seven left shoot do when you execute the statement. The result would be 24 right? The next operator is a ship, right? The ship right? Beat ways operator more all bits in its first Oprah shifting a value right. One place is equivalent to dividing by two. Shifting right to place is equivalent to integer division by fourth and so on. For example. Seven. Shift right one. When you execute this statement, it evaluates to trees. And if we say minus seven, right shift one, then it evaluate to minus four. Then we have a last bit wise operator, which is right shift with zero. Feel the right ship with zero pill operator it just like right shift operator, except that the bait shifting on the left are always zero. For example, minus one right shoot for evaluate to minus one. But when you say minus one, then MySpace. If I write shipped with zero feel Operator on specify for the value to this right. That's it. Arbit Ways Operator is completed. If you're not completely understand this complicated topic, then don't worry. It is not that much important. OK, that is all for this tutorial. We'll see you in the next one. 22. JavaScript Tutorials Serious Part 21: In this tutorial, we will learn a son main operator. On many occasion, you use assignment operator to assign value or too evil. Luit values off to grant the assignment operator. It's really very straightforward. As the name implies, Assignment Operator assigned a value to the variable so really called the previous lecture , where we use assignment operator to assign value to the variable, and we also use it in many expressions in the past. Lectures, we use Assignment operator to assign value to the variable. You can use assignment operator to assign value to the object on area. Also, we also show you how to use chaining system to assign value to a variable like this DRI. It's equal. Toe X is equal to 40 but the assignment operator is not as limited as you're thinking off. Using assignment Operator, you can do a pragmatic on beat wise operation, so let's take an example with some feature off assignment operator to minimize your code. The following shorthand operator would be convenience when you're working with the aromatic and width wise operator. So this is the automatic operator. The following is the example off aromatic addition. For example, if you have to a brand on. You want to toe first at them and assign its value to the first off Ron that the court would be looked like this X is equal to X plus white. So this statement will add to a plan and assign its value to the first off run. So if you declare two variables here X and y so I will say Leg X is equal to 10. Mama, why is equal to five? And we used these simple addition operator here. So I would say X equals do X plus why? And when we green variable x on the control, the result would be 15. Now, using assignment operator, you can perform the same operation just like this. I would just come in this statement on after that event, say eggs, specify the addition operator. And just after that basic by the assignment operator Andi Divide variable. So this statement equivalent do the previous one. So this statement post performed the addition and then assign value to the first upfront. It is equivalent to the previous statement, So when you execute this statement, the value would be 15 so it will first perform the addition off to a prints and specify the new value to the first Oprah. Right Next. We also have a subsection assignment operator like this X minus equal to why we also have multiplication assignment operator like this. Then we also have a division assignment operator on. We also have a reminder assignment operator. Right now, the assignment operator is not limited for the arithmetic operators, but using assignment operator, you can perform be twice. Operator. Also here is the example. So this is the Beach Boys left ship assignment operator. Now this is the width wise right ship assignment operator. Then we have a right shift zero field assignment operator. Then we also have a beat wise and assignment operator. Then we have a p twice or assignment operator and that the last we have a big voice. Zor assignment operator. Right? That's it. We know that how to use assignment operator in the program when you're making 1000 line of code that the shorthand operator is very helpful to minimize your cold 23. JavaScript Tutorials Serious Part 22: in this lecture, we will talk about some other important operators. Now. We'll first take a look type off operator type of operator mostly used to check the type off. It's a print, so the type of operator returns string, representing the type off. It's open. Unfortunately, type of operator doesn't exactly map toe the seven data type in JavaScript. The seven data types are undefined. No bullion numbers. It's drink same ball, huh? Object, So we just causes no enough confusion. So let's take an example and understand how type of operator work. If you wanted to find out, type off available that this operator help you out. So if you have one, then the using type of operator, you can find out its type like this, I would say Type off unspecified one here. Now the result would be number. Then we specified the string using type of operator and specify daily here in the double cork. Then you'll get string on the console, right. We also have ah William expression, so we'll say type off. Do so. The result would be brilliant, and we also have a no type, so I wouldn't say type off. No now What is the result When you're executed? A statement. The result would be object. Yes, that's true type of cooperative little object When you Jake Denial data type it usually ripper through as a book because no is not an object. Of course it is limited I It has been suggested many times that it fits, but too much existing court is already built on this behavior, so just memorized these. At the exception, you can also get the type off the function like this type all on specified the function. The result would be function. Don't worry. We'll talk about functions in the future. Lectures. So now let's move to the next very interesting operator, which is Mama. Comma operators simply provide a simple way to separate expression just like this, if we create two very was we use. Let why is equal to 40 Mama X is equal to tell. So here we use comma operators to separate two different variables that simple as that. After that, we have a grouping officer also so the grouping operator is parenting. Parentis is used to specify order off the operation. Phil used grouping operator to specify off render presidents. We'll talk about this in the future Lectures. So don't worry. We will cover everything. Stay Buster. Now the next operator is a white. You think this operator is useless because this operator has only one job. So this ah critter devalued its Oprah on. Do you don't undefined This offered are used when you want to toe return undefined value. So where do you use it? There is a different situation where you can use this operator. Suppose if you wanted to create an ankle tag in esteem Ill on Ben, you click on the anchor. Tackling the browser will take you to the another page to prevent his behavior. I will just use for the following court. I will just be clear, Anchor Doc with a trip after book and then in the double court, I will say JavaScript Colon white operator unspecified zero and then specify your ankle attack text and simple. Is that right? I hope you understand this lecture. The next Vittorio, we will learn the last operator off the JavaScript tutorial cities. This operator is new in my script. Six. So we will talk about this operator in the next tutorial 24. JavaScript Tutorials Serious Part 23: in this tutorial. Really? Loan destructing assignment operator. So what is destructing assignment? Operator. We had never heard this operator before. The destructing assignment operator is new in equal script. Six. Now we know that destructing assignment operator exist in Sikma Script. Six. But now let me tell you what is destructing assignment operator and what it does. Destructing assignment Operator allows you to take an R E r object onda de structure it into individual variable. So let's take an example off objects on Understand how destructing assignment operator work . So we will declare a normal object here. So it was a constant will be J. It's equal do on in the curly braces. I will specify some object properties like a cool and one mama B colon to while my C colon three on DSA a comma e colon fight and in the statement with semi column. Now we will use the destructing assignment operator here, so I wouldn't say constant. And in the current embraces, I will specify some variables. So I will say a B c Guan di on used assignment operator and specify object, right? So now I will just print this variable on the console. So I will say controlled, outlaw and specify variable a. So the result would be one. If you wanted to print the second property value, then I'm just base. If I'd be here, then the result would be to And if I say see, then the result will be three. What if I just place if I d here? What is these up? The result would be undefined because we did not specify d in the object property. So why not be removed one variable from here? So I will just remove the be variable. Now let's see what is the result? When you execute the statement, you will get an error message B is not defined the accord because off we did not specify variable in the destructing assignment operator. Right? So now the important thing is when you create destructing Osama operator, you need to keep in mind when you d structure an object. The variable name must match to the property name in the object. When you destructing assignment operator didn't match any property in the object, then it will return undefined. Also, we didn't specify be in the declaration. So the jobless gift return Editor message. You can do the declaration like this also. So I just grabbed this declaration in the parent places. But keep in mind when you're doing this type of declaration, it must be surrounded by parentis is otherwise gyroscope as you left side off statement as a block. Now let's take one more example off destructing assignment operator with Eric, So we will declare a normal air here. Like this constant today is equal. Do in the square bracket. I would specify some other limit. One comma, two comma. Three. Now we'll declare a destructing Osama operator here some say let in the square bracket. I will say a coma. Big is equal. Duke addict Keep in mind when we declaring an object. We use curly braces in the declaration. And when re declare Ari, we used square bracket in the declaration. Now we'll just print these variable on the console. So when we print a, that is, that would be one. When we print Be there is that would be too. On If I print see what is digital, you will get an error message because C is not vilifying. You will get the same results as an object so I will just add some more element for five and six. I will increase the element off Barry. Now, is it possible to store remaining Are element in the new variable? Yes, it is using spread operator like this with the three dots you can store remaining every element in the new variables. Just like this space. If I three dots with the variable name, so I will just say rest here. So I will just say console dot law and print Rest variable. Now, when you freaked the wrist variable, you will get the remaining element off the area. We will cover disparate operator in the future lectures. But just keep in mind that we use spirit operator toe print at remaining every element using destructing assignment operator, right? 25. JavaScript Tutorials Serious Part 24: in this lecture, we will talk about JavaScript operator presidents To understand how javascript e valued an expression. This topic is very important. Till now we have been covered most of the operators in JavaScript. Now we'll take a look at how JavaScript perform Operator operation operators are arranged in order from higher presidents to lower presidents. Operator presidents control the order in which operator are performs. Hire Presidents Operator performed before the lower presidents operator. Now consider the following expression so I will create a very evil here. Late X and then we specify X is equal to five plus three. Multiply by. Do Let's understand how jobs could perform This expression first just performed the higher presidents operator, which is multiplication. So the job was first performed the multiplication with three and two and then perform the lower presidents operator. So the addition is lower presidents. Operator on multiplication is higher, Presidents operator, So when the multiplication will complete it, Don Bosco performed the lower lower presidents, which is addition on After that double skill performed the Assignment Operation on Assigned Element to the X variable operator. Presidents can be or didn't with the explicit use off parentis is if you wanted to perform addition, operator first, then the expression looked like this. I will just wrap five plus three in the parent basis. When you perform this operation, the result would be different. Dollar script assigned 16 value to the X variable Because you perform lower, lower visiting operator first using parent cases and then multiply with two on assigned the value to the X ray table. Using parent is is you can perform lower lower presidents operator first. Now let's take one more example off operator presidents. So I would just come in this statement and here I would say X is equal to drink deep, divided by four plus do multiply by and in the parent disease. I will say seven plus four minus do and I would just say console dark law on base if I X to print the value off the X variable. Now when you execute this statement, what for? With the result, the result would be 23. Now, let me explain how JavaScript interpreter performed this expression. So the dollar script first performed the operation in the parentis is. Then it performed the division between 20 and poor after that JavaScript performed the multiplication and then perform the region. And after that assign value do the X variable. So now you have 23 in the X variable. Now, if you wanted to know which presidents level applied toe, which operator, then don't worry. I will solve your problem. Jaster provide different presidents level two different operators. I have created a chart off presidents level. You can download this chart from the link lorded in the description. After a few days of practice, you will have a complete understanding off operator precedents. Now only a few operators are remaining to understand. That's it. That is all for this lecture. 26. JavaScript Tutorials Serious Part 25: In this tutorial, we will talk about Ari on object operators, so we'll just look at some important operators in object and addict. Now the first operator is member access. You can assign this operator using a single dot as the name implies member accessing operator usedto access members in the object. In the previous lectures, we have seen how to create objects and acts of the members using member accessing operator . The syntax off member accessing operator is as following object. Then we specified Remember access operator on your property. The important thing is proper team was be a valid identify where and when you're accessing the property off the object. It must match toe the object property. A property consists off key value pair property. Keith must be string. Our symbol on value can be any type. For example, I would say constant or B J is equal to Ananda Curly braces. I will say I d colon one mama name Colon. I will say daily in this thing. Go cold right on toe. Access the property off the objects I will say consoled our clock and in the bracket space . If I object dot name in this example, we use member access operator, toe access member in the object. So using consoled outlaw, we bring name property value off the object. We have created a complete video on objects. If you have not seen this video yet, then must want this video first and move on. You can watch this video on the top right corner of the screen are from the description, but the NUTSHELL. Off this topic is using member access Cooperator. You can access members off. Doctor. The next operator is computed member object. So what is the use off computer member access operator? If you go to the past, then you would remember we used this operator to create an Ari this operator not only creating Ari, but also you can access elements. There is one more way to use this operator. I will use the previous object on access their property using computer member access Critter like this, I will say consoled, outlaw and in the bracket, I was basically I object and in the square bracket, it means using the computer member access operator. I would just access the property off Doctor. Now you can see you can access object properties using this operator right now. Let's move on to the next operator. Property existence Operator in the in operator to don't True, if it's left side, opera is in the right side. Oprah. It means the in operator returned. True. If the left side property is in the right side objects, for example, if I declare a simple object here, I will say Constant car is equal. Do and I will specify some properties like a C name means car name. BMW model. I ate on the ear ridges 2015 and I will say Console Dark Law and in the single court Ivan Space If I see name in car when you execute the statement, the result would be true because in operator much see name property in the car object. We had learned the basic use off in operator in four in local. Also, if you wanted to watch for in look video, then click on the card or here, or you can watch this video from the link provided in the description right. The next operator is new. The new operator is used to create an instance off the user defined object. For example, when you wanted to create an instance off the object. You need to create a class like this. I will say class Mardell. And in the curly braces I was specified. A constructor, right? When you create your class and constructor, no instance has been created yet Now, to create an instance off the model object, I will say constant. I see one is equal to new modern and I will say, but in thesis and place if I semicolon idea to create second instance, I wouldn't say Constand C Do is equal to new model. Now we have two instance off model object. We will take a brief look at class object on creating instance off the object in the future . Like just so. Don't worry. You'll get complete understanding to create class and instance off the object right in the next tutorial. Real cover remaining operators off object and Addie 27. JavaScript Tutorials Serious Part 26: In this tutorial, we will complete the JavaScript operators. Now the last few operators are remaining toe. Understand. In the previous lecture, we learn what is new operator. Now let's move to the next operator and learn what is instance off operator. The instance off Operator Tastes and LeBron on its left on right side. The instance off operator. Expect a left side, Oprah as object and right side up front as a glass object. The instance off operators evaluates to True. If it's left side Oprah, he's instance off the right side open. Otherwise it will return False, for example. You've likely it an instance off date here, I would say constant deep is equal to New date Now. I just wanted to know that a D is instance off the date, variable or not, so I would say console dot lock de instance. Off date. The result would be true because the is instance off the date object. Right after that, I will declare Inari I would say constant Harry is equal to, and I was basically some elements 12 and three. Now I will check if the newly created a day is instance off the area object. So I will say concerned about law and specify every instance off Abbey. Now the result would be true because the newly created object is an addict. But if I see console Dark Law and I don't see Addie instance off they now, the result would be false. Because Addy is not instance off the date object. That is why you will get falls on the console. Now we know that. What it's instance off operator. But do you know how instance? Operator work. If you wanted to know how instance Operator work. Then you need to understand. For Kotite Jane, this is JavaScript inheritance mechanism. We'll take a look at this in the future lectures, but now let's move on to the next operator daily. Did it? Operator is the unity operator, which used to dilate the Object property or our element. Let's take an example if I declare an object here so I wouldn't say foreign stunt O. B. J is equal to and in the curly braces, I will specify some properties X one. Why do and they treat now let me first check object property Eggs is in the object or not, so I would say console dark and in the single gold of unspecified X. Then we specify the in operator and specify object. Now the result would be true because eggs is the property of the object. Now, I just wanted to delete one of its property using village operator, so I didn't say delete. Specify the object dot x. Now I will leave the first property off the object. Now, when you bring this property, the result will be different. Now I will execute the same statement again. So I would just copy the statement on print here. Now, when you execute these, the result would be different and you will get falls on the console because property X is deleted from the object using billet operator. Right? So now eggs is not exist in object right now. Let's take an example off Ari. I really clear a simple area here, so I will say constant add. It is equal to and in the square bracket, I will specify some other element. One do three and four. Now let's print the fourth. Ari is a concern about raw, then praised by adding And in the bracket, I will say three. I will print poor under control, right? So I just want to displace it by three in the bracket because they start from zero. After that, I just wanted to be lead last element from Barry, so I will say Delete, Carry on in the bracket Haven't specified the Last Element Index three. Just after that, I just wanted to bring this element again. So I will say console dot lock on, specify the carry on. Just bring the last limit. When you execute the statement, the result would be different. You will get undefined on the console because the date operator will deliver the last Harry element. Right now, let's more to the next operator. The conditional operator. Now, what is conditional Operator? Now the conditional operator. It's Turner. The operator, eternally operator means it has three branch conditional operators. Has three Oprah. In the first, Oprah goes before the question mark. The second goes before the colon, and the third goes after the corner. Conditional operator. It just like if an else statement. But this operator is very handy in certain situations. Now let's take an example off conditional operator and compared this operator with eat an else statement so I will just create if an else statement post. So we just declare a variable here with literally Sorry I'm late. Spring is equal to and in the double court, I'm specify a message. Hey, everyone. After that, I will specify if an else statement. So I will say if in the expression and will specify Brent now In the statement block, I will specify consoled outlaw Andi. But in the video and in the else statement, I would just change the text off the print variable and specify. Welcome on, Bring this variable again. If I execute this statement, then what will be reserved? You will get everyone on the console because we specified value to the print radio if I just demoted Heathrow than the else block will execute. So I just a remove the Lakers from here on. Execute the statement again. Now the message on the console is welcome. Right now. Let's take the same example again with conditional operator. So I just used the previous bring variable on. I will say print a stick will do and then specify the expression. So I will say print. Then we specified the question mark, and then we specified the statement. So I will save Brink Colon and then space of I The second statement Now I will specify a welcome here. Now here. If the print expression is evaluated true, then we will return print through the print. Very well. If the free expression devalued toe false, then we will return Welcome text to different variable. Right? And just after that I will say console dot law I'm bring variable So when you execute the statement, you will get Hey everyone message on the console using conditional operator It is very easy to evaluate expression. And what if I just remove the literal from the variable you will get Welcome on the console . Conditional Operator is very easy on handy, right? That's it. Our JavaScript operator is completed from the next did Oh no. We'll start a new topic 28. JavaScript Tutorials Serious Part 27: in this lecture, we will talk about jump statements in JavaScript. They're our future, um, statements that are allowed you to jump from the specific place to the new location. This jump statements causes the JavaScript to jump a new location in the source court. Just like the break statement used to jump to the end off the look or other statement jump statement are used to jump the execution to the new location. There are a few statements that I love you to jump from specific location through the new location. Now let's understand how jump statements work. The first jump statement is break, so the brake statement used alone break statement causes the switch statement. Are the innermost, including Look Toby, exit immediately. The syntax off break statement is really simple. Just write a break you word like this and specify Semi colon. That's it. I think you already seen the example off break statement in the switch case. But break statement is not limited for that. Here is the example. I will create a four LaPierre so even so far and in the bracket I was specified late. I is equal to one. I is less than equal to five, and I blessed rights now even just print It is eye under control. Like so the result would be 1234 fight. You will get one to fight on the control. Now let's see what's happened if I use a brief statement in the look. So I just wanted to add the break statement here, So I would just specify if condition on in the expression I will specify. If I is equal to three. Then I will break the look. Now when you execute the statement, you will get one and do on the control because using break statement, we break the look execution. So when the IRA new became three, then if condition became true on executed break statement, then the break statement will terminate the look and exit plunder. Lou Block, Joe Escape Allow us to use break. You were with level statement. We will learn what is level treatment after a few minutes. But now let's understand what is syntax off break level? Statement. The syntax off a break level statement is as following, so I would say break neighbor name, unspecified semi column. So this is this intact off break level statement using the break level statement with the break you were the break execution jumped to the terminate, including statement that has specified level now will first understand what is level statement now. The statement may be leveled by presenting it with an identified on a semi colon. Using the label statement, JavaScript allowed us to specify a name to the specific bluff that you can refer it to the elsewhere in the program. You can label any statement, although it is very helpful when it has body such as loops. By giving the name, you can use a break statement inside the body. So here is this Intacs hop label statement. So I will say I didn t fire colon statement. I'm just specified semicolon guardian. No, let's take an example and understand how label statement work. I will just write some cold here so I will say Let a equal to one and then I will say label colon and then specify divide. Look seven servile in the expression I will specify a is equal to one, and in the statement, I will print the A on the console using controlled dot log maternal and then I will say Break label. So now when you execute the statement, you'll get one on the console. If you only the break level statement than the winds. Go. Execute thousands off time because we did not specify any false statement in the wild dog to terminate the look. Now, if you remove the break level statement on execute thescore, your browser will print one on the console more than thousands of times, and it will be continuously printing the one value on the console. So don't remove the break statement. Otherwise, you could need to close your browser right. 29. JavaScript Tutorials Serious Part 28: We will continue the previous lecture on Learn some more jump statements. Now the next jump statement is continue now. The continue statement is similar to the brake statement, but there's one difference in the container statement except terminating the loot. Continue statement will restart the lobe from the next filtration the country mistreatment syntax it just like as simple as break segment just like this. Continue and specify. Semicolon can also use with level like this. Continue and then specify the level name right you can use continue and country new levels intact in body off the loop. If you use this syntax elsewhere, then it causes a syntax error. Now let's take an example and understand How could you? State may work. For example, I will declare a variable here, so I will say Let X is equal to zero. Then we'll create over. I look so I will say, while and in the expression I was petrified Eggs is less than then and specified the compound state run using country braces. Now here I will first increased the value off X using post incremental operator, I would say X plus plus After that, I will use if statement and in the expression of space. If I X is equal to five, then I will continue the statement and after that I will bring X on the consults. I will say consoled Outlaw, that's basic by X. Now, when you execute this statement, you'll get 1 to 10 on the console. But it does not bring five because we use something in the court. Reuse if conditions continue statement. So as you can see country, the state men will skip the rest off the court and country new device loop. So when the country statement execute the execution goes at the top and continue the via look without printing the X value on the console. Continue statement. Also use when you have some expression that terminate the look using false expression. In that situation, you can use a continue statement to continue the look. So without dominating the look, countries statement will continue the attrition on Execute your look Right now, the next statement is return, so mostly written statement used in the function as the name implies, different statement used to return value to its color. Following is this intact off return statement so I would say that it done and space if I expression as simple as it is a syntax error for it to appear any burials, the function that contains the victim's statement returned the expression to its collar. But example So to create a function, I will say function and then specify the name off that function. After that, I will replace it by the parent pieces. And in that Farron thesis, I will specify argument. I wouldn't say x here, and just after that I was basic by the body off that function. So in the function body haven't specified done statement with eggs plus X expression. So here I've just returned the addition off to equal values, right? Just opera that I will print the X value on the consult. So I will say consoled, outlaw in the parent pieces. I will call the function, I would say, and in the parent pieces, I'll specify the parameter value. Starting saying three here, right, so when you execute the statements, you will get six on the console. So when we call the function function, return its value to its color. So using return statement in the function, with little addition off to equal values. If we just changed three and specify five year, then you will get 10 under control, right? We will learn the function on the perimeter on all that infusion lectures. But just for now, little statement is used to return a value to its color. Keep that into your account. That's it. I hope you understand this lecture. From the next tutorial, we will learn what its function. Don't forget towards the next tutorial because it is very important to understand what is function. Function is used anywhere in the JavaScript program. There are also a few jump statements are remaining to understand, but we will cover that after a few lectures. 30. JavaScript Tutorials Serious Part 29: So in this story. Oh, you understand What is function on how to create function in JavaScript on were to use it now in simple words. Function is just a collection off statements that would run as a single unit. You can take function adds so program function. Start with the function cure followed five function names. Function is very useful when you want it to execute the same court again and again without writing the same court. In the separate file, you can just call the function and execute the same court again. The function will have been safety are a lot of time. Now. Let's take a syntax or function and understand how to declare a function. So, as I said, functions start with the function key word followed by function name. After that, we specified parentis is on in that parentis is you can pass common separated optional arguments. The perimeter arguments are optional. Now. The body of the function is composed off any number of statements, so these statements will not execute until you call the function. Keep in mind, the curly braces is not the optional parts off the function. It is necessary to specify curly braces put a function even if the body off the function consists off only single statement night. Now let's take an example and understand how function well we will take a simple example found save function so we'll start a function with the Function keyboard and specify name. So I will say magic Here and Spacey five parent cases just for now. We did not specify any argument to dysfunction, and I will just base if I curly braces Now here in the statement, I will say consoled, outlaw and print Hello on the console, I will again print one more message. So I was a console, dark law and prayed function message under control. Now when you execute the statement, you won't get anything because you just define function. To execute the function, you need to call that function in the program. To execute this function, you need to call them just like this. So to call this function, you need to specify Name off your function like this. So I will specify the name off my function. Magic on specified guarantees is on at the end. I will specify semi Colon. Now when you execute this program again, you will get hello function message on the console. Now let me tell you how execution work. So when executed statement it will force Goto the magic statement right here on call the function. After that, it will bring message on the console on exit found the function at the end execution will end the magic statement on exit from the program. Now let's take one more example with return keyboard. In the previous lecture, we know that what is used offer it and cured. Now you just use this cure to return a value to its color. For example, I would just bring some message again with the return key word. So I will just first get rid of these two statements and say they don't on in the double court. I'm specify hello function. When you execute the statement, you will get hello function on the console. There are two ways to call the function when you use parentis is just after the function you're calling the function on you tell JavaScript toe done body off that function now there is one more way to specify function without any parent Is is when you did not specify parentis is you are refering to the function object Just like this. I would just get rid off this statement and say magic and space vice every column. Now, when you execute these, you will get function on the console because this statement referencing toe the function Now when you have referendums toe that function, you can assign it to any other user defined variable Just like this, I will specify a constant variable. So I will say constant f is equal to on. I will specify name off my function. I would say magic here and after that I will call the function using the difference. So I would say if, as busy five paren thesis. Now, when you execute these, you will get hello function on the control are you can do the same thing with object also like this I really clear a constant object here. So I would say constant object Bobi J is equal to and I will specify a property starting space. If I f Gordon and call the function say magic here right now using the first property, we will call the function just like this. I don't say object dot and crazy five parent cases. Now you'll get hello function on the console. So here we just referencing to the function using object property. Right, that's it. 31. JavaScript Tutorials Serious Part 30: In this tutorial, we will take a look at function arguments and a fort arguments so well, first, understand what is arguments in the previous video. We learn how to declare a function now in this lecture, we will understand what is arguments and how to pass arguments through the functions. Now take attention on this line the primary mechanism to pass information to a function called his function arguments. You can also call them perimeters. Argument is just like a variables it just used to fast values to the function. Arguments doesn't exist until the function is called. So let's take an example and understand how arguments book. So we will force create a simple function with two arguments. So I will say functions and 50 find me so I will basic by day more here on past two Perimeter seven space. If I e. Mama beat two separate arguments, we will utes calm operator, right and in the body off that function, I will specify a return keyword with additional two variables divided by do so. This will give us average off these two numbers, and after that I will call the function. So I would say demo and pause two values to dysfunction. So I would say, Right, Mama 40 right? So when you executed statement, you'll get 22.5 average right now in this function A and B, it's formal arguments. You can also call them formal parameters. So when the function is called, the formal arguments that received values and become an actual arguments So now let's understand this process. They're busted. In this example. Former arguments A and B received values five on 40 and become actual arguments. Now you have five and 40 value in the function arguments A and B function. Arguments are exist only in the function. You cannot accept the function argument outside off the function. So when the function has been called A and B become five and 40 then function will return the average off five and 42 its color. What if we just specify the variable except specifying the value like this? So I will declare a variable here, so I will say let A is equal to five on B is equal to 40 now. We'll use this valuable as argument, so I will say demo on in the parent pieces. I will specify A and B as a argument. So what will be diesel? The result would be same. You will get 22.5 under control. Keep in mind when you create a function, the function name must be a valid identify. Right? So now here we passed two variables and be when we call the function and be distinct variable from the arguments and be in the function, even though they are having the same name. When JavaScript called dysfunction, JavaScript won't pause the video able as a function arguments except job script will fast variable values through the function. It means in the function arguments. You have five and 40 in the function. Arguments variable now in Moscow, up six. There is a new concept. Introduce default values for arguments. Normally, when you did not specify, people rally to the variable returns undefined. For example. I will create a function here, rivals the conscience F and in the Parenti says, I will specify a single argument. I would see ex on return these eggs to its color, so I would say they done. I will use back take to specify the string. I will use the interpolation to bring the value of X variable right now, I will just call this function. When you call this function, you will get undefined variable value because we did not specify any argument to the function when we call them. So here we have a new concept default values for arguments. We will take the same example and just make some changes in arguments. I wouldn't say X is equal to and in the double court I was base. If I a string so I would say default here. So we specify X as a strength with default value. Right. So as you can see, we just place if I deport value to the function parameter. So when you execute your statement, you'll get default on the console. If you just change the default value and space by three, then you will get three under control right now. As you can see, you can specify any primitive an object data type in the perimeter, right? This is very amazing. Way to specify devolved rally to the variable 32. JavaScript Tutorials Serious Part 31: in this tutorial river learn what is an animus function. Where do you use it on what is the use off anonymous functions? So till now we have been learned how to declare a function on how to specify arguments to the function. Now we'll take a look at what these animals function when we specify function. We specify both body on identify, but JavaScript support and only must function, which you don't necessary to have an identified. You might be wondering. How will we call the function if we don't specify the name for that function? Now wait a few minutes and give this topic aside and talk about expressions. Now we know that an expression is something that he valued toe a value, and we know that functions are values like any other. In JavaScript, you can specify function as an expression and only was function. Help us to do that, so when you declare a function as expression, you don't need to specify. Identify air for that function. When you use function as expression, off function expression can be assigned toe something are called immediately. We will create a variable on a sine function as expression next consider the following example. So I will create, available here or even say Constant is equal to. And then he's basically function here. So I will say function. But in pieces on just basic five, the body. So here is your statements. So the outcome off this function is same as if we had declared the function in the usual way. In this function, we have variable as identify that refers to the function. So if we wanted to call dysfunction, just use em on. Specify parentis is like this, right? The only difference is that we are creating an animal. Its function on assigning eight tow the variable. Now you know that about is anonymous function on how do you use it? But now we just wanted to understand why we need to use anonymous function now. There is a different situation where you need to call function immediately. Anthony was function used as a argument are as a metal or to create function properties in the object just like this. In this example, we will understand how to use function in the object property. I really clear an object here, so I wouldn't say constant oh is equal to and in the body off that object I'm in space. If I first property so I will say name Colon. And in the double court I will specify anonymous function. Now I would be clear a second property. So I will say in book So invoking the name off my second property. Then I will specify value for that property. So I will declare a function here silencer function in the body of that function. I will specify it Don't work with some message, right? And after that I will hear, say control dot law on call the second matter which is involved and space if I bad in pieces the space If I patent cases here because we need to call the function now what would be these up? So when you execute the statement, you will get you called me a message on the control. In this example, we had created an object with two properties name on import for the involved property. We had specified function expressions. And to call this function you need to space. If I object on a call its property, it parentis is if you don't use parentis, is when this will be, return the difference or function. You can do the same thing with shorthand, syntax just like this. So I will just re Moti Golan on function keyword like this. So when you execute this cold, you will get the same outcome. That isn't guarantees. We use mental in the object in MMA Skip six this is a new shorthand syntax bar, Mater's. So here invoke is the matter on to call this matter? We use object Dark matter name It's parentis is we will understand methods on objects in picture lectures or just for now, keep in mind to declare a meter. Just used the name off that method on specified body just like the function body, right? 33. JavaScript Tutorials Serious Part 32: In this tutorial, we will look at very interesting topic in JavaScript, which is Adul notation in Sikma Script six. A new kind of welcome syntax called arrow notation. To specify Addo, you can use equal sign with greater than operator this new creature. Help me to reduce number of times. You have to try the world function as well as a number off curly braces you have to type at a function allows you to specify syntax in three ways. First, you can omit the function keyboard. Second, if the function take only single perimeter, then you can already departed. This is code. If you're function, have only single statement, then you can omit curly braces. Also, I don't functions are anonymous. In the previous lecture, we learn what is anonymous function. If you wanted to know what is anonymous function, then you can click on the link on the top right corner right after that. Keep in mind, you can specify. Identify their for the other function like you can with the function keyword. Now let's take a look. A few function examples. So if you want to to create an anonymous function to return a message, you will write this so saying constant F one is equal to function and really done. Hello, everyone, right? You can do the same thing with arrow functional so like this. So we'll create a constant tradable. So I would say constant have one is equal to So here we will only be function cables on a directly space. If I parentis is arrow, so I will specify equal sign with greater than operator. And just after that, the O medically braces on specify hello, everyone in the welcome. So in this example, we omit the function keyboard on after the talent is is the space if I heroin tradition. As I said, if you want to do space, if I only one statement, then you can omit curly braces while creating arrow function. Now let's take one more example of Arab function with only one argument. So if you want to to create a function with only one argument, you will write. This constant have to is equal to function, and here you will specify first perimeter and in the body, you will say return value off. The argument on bringing this argument on the console are you can do this with other functional like this. So I would say constant f do his equals. Do so here before, specify arguments. We did not specify parent cases here, so we directly space if I argument here with adults. So we specify argument one. Then we specified Adul. And then you specify body of that function without Carly braces. Right? So we'll say, value off the argument and print this argument on the console. So here both functions are saying no. If you want a toe, multiply two values, then you can do this. Constant F three is equal toe function. Andi specified two parameters here, so I will say argument. One comma argument to and in the body will say Well done, Argument one. Multiply my argument to now let me show you the same result using at a function So I will see Constant three. And in the parent pieces, I'm specified Argument one mama argument to. So here we use to perimeter. That is why we use parentis is to specify arguments. After that will specify arrow on called the Body. So say argument one. Multiply by our grand too. Now, using this example, you'll understand how you can use the arrow function using at a function. It is very easy to declare a function with arguments. Now we will move to the next topic. This giver Discover is normally associate it with object oriented programming, and we will be learning object oriented programming in future lectures. However, this giver has also some important features on it can be used in multiple ways. Normally, this giver is related to the function that our properties object. This giver normally refers to itself just like we create an animus function and specify different toe that function in the variable. So this giver refers to the current object where he used. Now let's take an example and understand how this cute work like this. So I was a constant LBJ is before I do so here we specified two properties for this object rivals the name on the specified destitution for the name property on. We will create a matter here so I will say magic and then specify parent pieces and in the body off the magic metal. We'll say return hello and called the first property using discover. So I will say this dot name right. And after that using, consult or talk, we will call the magic method Now, In this example, we had created an object with two properties. So first we declare a name property with destitution message on. Then we create second property in the second property. We specify magic matter on written Hala message with first property value you can see here we use this keyword to call the first property off the current object. So when you execute the statement, you will get Hello destitution Message on the console. Now hear This giver is bound to the object. Not because of magic is the property of the object but we called it directly on object. Now, if we create a reference off this object on compare both using assignment Operator then what is the result? Just like this? I will say constant and one is equal to LBJ daughter Maggie. I will compare this using assignment operator so I will say console dot law and say and one is equal to object will be j dot magic. Now the result would be true, right? Because both have the same reference off the same metal. And if you call this Mr using reference, then you will get this output. So here JavaScript called undefined to discover. Because Joss paper do You don't know that this giver is originally declared in object. Variable so discovered, bound to undefined, right? That's it. That is all for this lecture. 34. JavaScript Tutorials Serious Part 33: in this tutorial, we'll take a look at Destruct Oring arguments in the operator tutorials. We have seen the structure assignment operator. Now, in this lecture, we will understand the structure arguments. Restructuring is a convenient way. Toe extract rallies from data in the object are carry. Using the example, you will understand how to use destruct chur arguments, for example. So I will create an object here, so I will just base. If I constant is equal to on in the Curly braces. I will specify three properties, so I would say W one and then specify dearly. Then I'm a space of my second property. W Do Duchin on. I will specify still property, so I would say w three doing else. After that, I just wanted to create a function that returns these three properties to its color. Right? So I would say function, get data. And here in the argument, I will specify the structure assignment operator. So in this curly braces, I'll specify argument. So I will say W one mama W two mama W treat General hear these arguments are completely distinct from the object properties. Now in the body of dysfunction, I will say it is done and I was just returned The three argument using back dick. Right? So I will see we don't. And in the back Dick, I will fall. Specify first argument, then specified. Second argument on then specify my toe document. Now I will just say console that law and print object properties on the console. So I will say Get data. So here I will call the function on in the perimeter without specifying each property. I will just base if I the object. So I would just space if I all here. So when you execute this statement, you will get a destitution Editorials message on the console. Now, in this example, we are just extracting different properties from the object using the structure arguments Keep in mind your arguments are valid. Identify using the destructor argument. You can extract multiple values in the object on time. You can do the same thing with aerials off for examples. I really clear and out of here. So I will say constant a r r is equal to and in the square bracket I will say daily Mama Duchin Mama tutorials. After that, I will create a function so I will say function, get data So they say it's where bracket. And in the square bracket we'll declare three arguments. So I will say W one comma w do comma w three and I would just returned this three arguments using back Dick Operator Right now, I will just call this function in the console Dark Law. So I will say console dot law on call this function using the function name that was, They get data on in the perimeter. I will specify Harry, so I will say a are are. So when you execute the statement, you will get the same output on the console because the structure arguments extract values on display that values on the consult. So here you need to understand one thing, which is when you create the D structure Ari argument, you need to specify square racket. And when you want to to extract values from object, you need to specify curly braces in the destructor arguments. Now, using the structure arguments, we extract values from the area. Right now, we will go to the next topic call meter. You will be wondering what it's called. Matter Call is just a metter available on all functions that allow you to call the function with a specific values off this giver. In this topic, we will take a small example that gives you an understanding off the use of calm Attar with this giver, for example, I would create a function here. I will say function magic and in the body of dysfunction I was specified Turnkey World on returns a message. So I will say Welcome to using interpolation. I will just say this dot name, right? So I will just call the property off object. But we did not specify any object here We call the object using call matter right you will see after a few minutes after that will create two objects. I will say constant over Giron is equal to and in the curly braces with present find name daily on build basic By second objects, I see constant or budget to and in the curly braces who specified name to shame. Now using console dot talk feel first called the function. So I will say magic. Using the dot operator, we will call the call meter, so I will say dot call on in the parentis is here. I was specified Perimeter for the call matter. So here space if I object So when you execute this, you will get welcome to daily on the console. So using this example, we wanted to show you how to access objects within the function. Only with this givers. So here you can see we call magic members on using dot operator, we call calm it hurt and space if I object in the perimeter. So now, using call matter this giver bound to the call object. So it means this giver rivers toe the object which is specified in the argument. So a few spacey five second object in the call meter perimeter. Then you will get welcome to to shin, right? 35. JavaScript Tutorials Serious Part 34: in this tutorial, we will talk about really both scope now. This is very important to understand the school off the valuable. When you declare on wantedto access that variable, sometimes if you're accessing variable outside of the school, then you will get an error message. Taking this to Toyo will help you to use proper variable school and take away entered messages So their school started and understand what it's called school leader Mine when, and they're variables constant on arguments are considered to be defined. Now you know that arguments in the function only accessible in the function body. For example, if we declare a function here so I will say function f I was raised by one argument here, so I will say X and agendas arguments. I will say they don't x divided by two. I will just call this function so I will say console dot law and in the Parenti sees I will just call this function and specify argument. So I will say and independent. This is specified death. So when you execute the statement, you will get five on the console. Now, I just wanted to access the X variable outside off the function so I wouldn't say consoled , outlaw and say x here. So when you execute these, you will get an error message. You will get a reference error message which, say's X is not defined. You can see you found access function arguments outside of the function. Right now, let's understand what is lexical scoping? So when you look at the program, you are looking at the lexical structure. When the program actually runs, execution can jump around. Consider the following example on Understand how lexical scoping work. So I will say function if one on here in the body off that function, have a space. If I consoled or law and say function one After that, I will declare one more function. So I will say puncture and do and say unsuitable doctor. No function do now. I will just call this function randomly, so I will say f do at one and then call after. So this program is just a CDs off statements that we generally really from top to bottom. So when you execute this statement, it will first call the second function, then called the fourth Function and called the second function again. So you will get function to function one on again function do under control, right? Electrical Scoping JavaScript means that a variable defined outside of functions can be accessible Inside another function defined after the variable Declaration, Consider the following example so we will take one more example. So I will say constant X is equal to five. And after that I will declare a function here. So I will say function. And in that function, I will say consoled up law on access the outside variable. So I will say x here. And just after that I will say consoled outlaw on call, divide variable when you complete dysfunction. Just after that, I will declare why very well here. So I would say constant, why is the quota poor? And then I will quality function. Now I have a question that whether the variable can be accessed within the function if we declare them outside of the function school, the answer easier. You can actually the outside variables in the function, so these programs execute top to bottom. But when you call the function, we already declared the variable so here because we did not specify any scope. So the variable. You can access it inside all the function. So here before declare eggs and why variable and then quality function. Right. But what A We declare a variable after the function. Invoke. If you do that, you will get an error message on the console. The reason behind this When you call the function, you are accessing the variable without declaring it. As for JavaScript, rule says you can't access the variable without declaring it. So in this example we called function and then declared the variable wife. So that is why you will get an error message off Undefined Y variable. Right? That's it. I hope you understand this lecture. In the next tutorial, we will understand what is global scoping. 36. JavaScript Tutorials Serious Part 35: in this tutorial, we will take a look at Global on block scoping. You know that when you declare a variable it has a specific scope. You can only access that variable in that space epic scope. But now we will understand what is global scoping So when javascript program starts before any function called it is a global scope. Anything which you declare in the global school will every level all over the program. Anything which you declare in the global school is called global school. Frankly speaking, global scope have a bad reputation because global scope available in all over the program on it causes the error. If you declare the same identified, I personally suggest you two don't rely on the global school. Now consider the following example on understand what is his thesis advantageous when you're using the global school So I will declare a simple example here. So I will say Let name he is equal to daily. Then I will create a one more variable side select so is equal to 4000 after that have been created function here So I will say function show and then in the state plane I will say consoled outlaw on a princely name value. So I will say dollar. And in the curly braces I was ceasefire name. You have so subscribers. So here I just wanted to pray daily you have 4000 subscribers. Right after that I will create one more function. So I will say function, make. And then in the body off that function, I will say console dark law and say thank you so much. So subscribe us And I really wanted to thank you. So subscribing this journal on give me a lot of support Now more into the example. Now, in this example, we are using global variables. So here, name and subscriber is the global variable which you can access anywhere in the program. You can see both functions are highly dependent on the global variable accidentally or say intentionally. If we change the name are running off the global variables, then this will affect toe the function. Because both functions are relying on the global variable. Not a better approach to use this global variable. Is this so here? I would just get rid off these global variables and hear everybody clear an object. So I will say you ther he is equal to and in the body off that object, I will declares two properties If I would say name daily on I was declared a second property. So 4000. I just changed this sentence on just remove the global variables and specify my object properties here. So I will say user dot name And here I will tell you, user Dark self And here I don't say user doctor Selves. Now the result would be seen. So in this example, we just put global variables in the single object. Doing this, I reduced global variable name conflict. Suppose if you wanted to declare more than two variables, then you can use global scoping because it causes the ITER often in conflict. In that situation, when you're using more than two variables basic by them in the object using this approach definitely help you reduce name conflict. All right, now you know that what is global scoping now we will move to the next topic and understand what it's a block scoping block scoping is oppose it from the global scoping in the block scoping which specify a specific area toe access the specific variable value outside off the scope you can't access that way. They were value using block scoping. You can specify boundary toe the variable, preventing access from outside function block, scoping the statements surrounded by curly braces. Now let's take an example and understand what is a block scoping. So here I've just bringing some messages on the control and print variable values on the console. So I will say consoled, outlaw on in the present pieces, I will say lock stock. After that, I really clear a curly braces here, so I will start the clock. From here on in this block, I will say console dot law on, say, inside a lot. Just after that, I will declare a variable. So I would say constant X is equal to fire on print that value on the console five second Soldat Law and say X here just after the block, when the block and I will say console dark clock on print. The message Bach end and after that I will access the X variable and say consoled outlaw outside off the block X is equal to and print X value here. So here you have a standard on block usually a block is a part off control flow statements such as, if on for look, but it is when it's intact to have a block off its own. Now, when you execute the statement, you will get a film messages on the console. So here you can see general script for start the block in print message inside block. After that, it will bring X value on the control and then bring love end. Just after that, we will bring the X variable on the console. Just after that, we wanted to access the X value, which we space ified in the block. So when you do that, you will get an error. Message X is not defined here. You can see we cannot act. Is the X variable outside off the clock? So now you know that What is the user block statement? 37. JavaScript Tutorials Serious Part 36: now in this lecture, we will understand what aides closure. We will understand what is closure is all about and take a few examples. It is very important to understand what is closure so much. Watch the complete tutorial. So what is closure? Closure is the combination off function bundle together with references to its surrounding states. This definition is more complicated right now. Let's treaties in simple words. In the other words, the closure give you an access to an upper functions go from the inner function. It means closure is simply a function inside another function to expose it. Now here you can see we used expose word for the function to expose the function. You can use the return key. Words are you can pass it to another function. Now let's take an example and understand how closure looked like. So I will declare a function here. So I will say function counter on in the body of that function, I will declare a variable. So let count is equal. Do zero Now you can't access this variable. So to access this variable, I will say, But it don't. I would just return a function, so I would say they don't function on just returned the count variable on increased the value by one using both incremental operator Right now, after the function, I will create a difference off the counter function. So I will select counter is equal to counter function. After that I will just three this counter function under consult I will just bring discounter function three times. So when you execute this example you'll get 01 do under control. In this example we created inner function on outer function. We named counter to the outer function on Vicky It animus function in the counter function as a inter function. Now you can see toe expose the variable we use closure and don't outer function readable As you know, you can't access the function variable outside off the function but using closure you can access them with just a detain Cheever on using to function. You can return variable to its color. No lipstick. One more example off closure. Select on every declare a standard on block here on in this block. A late love is equal to Victor. I just wanted to access the block radio outside of these both So you can access this people outside of this rock, you will get an error message, right? Well, you know that you can access the variable outside off the dogs go. But judging the closure, you can do that just like this. I will just create a function here on space. If I a reference to the closure variable. So I would say closure is equal to function. And in the body of that function, I will say consoled or law on space. If I block radio now, when you call the grocer, you will get blocked waiting for value. So now when you execute this statement, you will get character on the council. Because using closure, you can access the inner variable outside off the function. Right? Let's take one more last example Read object. So in this example, we are using arrow function as a closure. Stick attention on this example, so I will select f I'm really clear available here. So I was let s. And after that, every little create standard on block and in this block having nuclear an object. So I was late, or B j is equal to on specify a property service and name character. So now I just wanted to access this object outside off this block. So you say is equal to on. After that, I will specify at a function here. So you know that how does spaces by adult function so just base? If I parentis is and adult right? And in the current address is I will say it don't or B j right, And just call the function. So when you execute, please, you have reference off the object in the function. Now, if you just create a reference off this function, then you can access the object properties like this So I was left is equal to I will call the function. Just after that I was consoled, outlaw, and just say, ref dot name right? So when you execute these, you'll get character on the console. Now, using the reference, you can access the object. As you can see, you can access the blocks called variable outside off the block, using closure right 38. JavaScript Tutorials Serious Part 37: now in this do Toyo, we will understand What is I f e? This topic is very important to understand because in many situation you will need this. So we will understand what is I have e i f d stands for immediately invoke the function expression immediately invoke function expression declare function on learning immediately . Now we know that when you create an enormous function you need to create function expression on space. If I that anonymous functions available and then you can access the reference off that function on, call that function using the parent places then why we needed this? There isn't behind this. Is that anything inside? It has its own school on because it is a function it can pass toe any other very vote on it . Call immediately after its declaration. Right immediately invoked function expression Look like this. So I'm just declare a parent thesis here on in that parent thesis, I will wrap de function. Okay, so I would say function. So here I will, creating an an enormous function on here. You can specify the body up your functions and just after that here space if I open and closing parent places. So here we create an enormous function using a function expression and then immediately invoked that function. Not in this Intacs. We created a parent thesis on put function inside this parent pieces inside this parentis is we declare a simple an enormous functions. Just after that the space if I the bodies off our functions. And then after the closing curly braces on closing parent pieces space If I open and closing parent pieces right for here. So this parentis is called this function immediately. Using the example you will have a better understanding off this function. Let's consider the following example. I would just create a function and space if I dysfunction toe the variable. So I will say constant f is equal to on in the Parenti sees I will put an animus function So I will say Valenti's is on here. I will specify function on in the body off that function, I will say let STR is equal to and in the double court will specify immediately invoke function expression. And just after that, if he done this year right, don't forget to specify. Parentis is just after the closing. Parentis is poor. Here right on. After that I will just call the variable using console door lock. When you execute the statement, you will get immediately invoked function expression, message on the console. We just created an anonymous function on call this function you think parentis is now? What if we remove disclosing parentis is from here. If you do that, you will get a reference off that function. Now if you want to toe execute this function immediately unique to space if I open and closing parent kisses or here if you want to toe river dysfunction toe any other variable you don't need to space about this parent Aces just space if I dysfunction toe the variable and when you call this function just basic five Parenti sees with the variable right now you know that you can access the function variable outside off that function in previous will you We learned how to access that variable using closure but example So I will just get rid off a body of dysfunction. And here I will just say let count is equal to one. On using return keyboard. I will just return a function so I will say to done and in the body of dysfunction. I will say it don't. And in the back, Dick, I was a value off count and just using interpolation, I will just specify my account Variable with post incremento operator. Right. So here we just wanted to increase the value off the count variable by one. When we call the function just after that, I will say consoled or law and space. If I if variable So I will just speak to Fife. Aren t C just after the half Reliable. I would just call this statement three times. So I would just copy this statement and pressed it or here. So when you execute this statement you will get 123 on the console using closure, you can access the count Variable, Right. So here, if you just space If I f variable, then you will get the reference off the function because we are returning a function Today's variable. Now, if you want to do call this function, you need to specify parent, this is over here, right? That's it. I hope you understand this lecture 39. JavaScript Tutorials Serious Part 38: In this tutorial we will understand what is difference between leg and market And we will also take a look at JavaScript. Stick more brutal force. Take a look at a let and barkeeper So what is the difference between late and were cured in the earlier version Off peak muscat six reused racquetball to declare a variable just like this. So to declare a variable we will say Well, we we will face if I the identify where Sirota V is equal to four and just print this one control. So using this statement you can also declare a variable. So why Basket Waas needed to invent Let giver vac evil is available everywhere in the current scope even before its declaration. For example. So I will say consoled outlaw on bring X variable here and after that I will declare marquee word. So I will survive. X is equal to four. So if you run this example, then you will get undefined on the console. But if you just space if I let giver except where so the x variable then you will get different outboard. When you do that, you will get an error. Message X is not defined, right? The reason behind these when you space if I bark able to declare a variable JavaScript to scan the entire school on declare X variable with undefined value. But Joe ask it does not assign value to that radio This mechanism called hosting. Now let's take the following example on understand what is the difference between late and giver? So I will just create a simple example with for look So I would say far where I is equal to zero I is less than three hi plus plus and just bring I variable here and just after the for loop I will say consoled outlaw And here I really reined I variable again. So I will say, outside block on brain I've variable After that I've been created one more for low So I will say far let so I really use let giver here to declare a variable. So I was let okay, it's equal to zero que is less than three gay last plus and just bring this gay variable on the council. And just after the block, I would say console dark law and bring gay variable. But I will say outside block and just space if I gave valuable right. We're using concatenation here to con coordinate value with the string. So in this example, you can see when you execute this statement you will get X value outside off the block, except that you will get any message when you're accessing the late variable. I hope you understand What is the difference between Let and Rocky Road You cannot access. Let giver outside offered SPLA While you can access their variable outside corporate stock right now, let's talk about what is straight mode in Sigma script fight. If you forgot to declare ran givers and telescopes as, um that you were refering to a global variable if no such a global variable exists, then JavaScript create that one. So this has been a source off a programming. Better for the solution. JavaScript introduced a concept off street more, which will prevent implicit nobles to use street more in your program space. If I string, use strict in the level coat on the top before any other code. If you do this the entire program around in the street mode, if you want to toe execute function in the street more, you can specify this string in the function. Also, are we just first take example off global strict mode. For example, if you just space if I x is equal to global and just bring this on the console right now, when you execute these, you won't get any error because Joe escaped. Create X variable on as you as a global variable. Let's add a street mode in this program. So I would just say in the double court aerospace, if I yields strict so I would just add a street string here on I will say in the double court, I will space if I yield Street now. When you execute this, you will get an error message on the console. X is not defined now, Joe Skip, run the entire school in the street mode. When you run the entire school in the street, more JavaScript will not assume this variable as a global. So you will get better. X is not defined. You can do the same thing with functional so like this. So I would just create a punch in here. So in the parent pieces I've grabbed the function on just say use strict declare a variable X mobile and just bring this variable on the console. So when you specify this street more in the function, this strict more is only available in the function. Using stick more, you can secure most off the error messages, so when you execute days you will get better message, right? 40. JavaScript Tutorials Serious Part 39: in this tutorial, very briefly. Look at an area we will understand how to declare an addi on a different type of Harry Little's. In previous lectures, we understand how to declare an addi and use them now. In this tutorial, we will take them in briefs on understand how to declare a different type of at a literal So let's get started. So you know that added, it is a simple collection off data, which you can manipulate any time they are ordered with numerical in. This is Ari in the jobs group can be any type. It means in John scripts that can be known homogeneous. You can specify any type of data in the elements. Every area has a lead property, which tells you how many elements are in the air. A variable Littles are constructed with square brackets on the same square bracket are used to access element by index. Now let's take a look at a different type of Harry Little's, so we will create a simple out here. So I will say constant, a r r one, these equal do and now to create Addy, we know that we need to specify square bracket so I will just space If I x square bracket here on in this racket, I will specify at an element. So I will say one mama do comma three Guam A poor on comma fight. So we have five elements in the attic now to separate each element were using the Kwame operator Right now let's take another little bridges. Non homogeneous holds a constant Harry to needs equal to on here in this area with space. If I different type of data shovels place if I won in the level coat Mama do which is number Mama True which is 1,000,000,000 type right? So this area is non homogeneous area which has a different type of data. Now let's take one more literal So I will say constant at a three is equal to now disease, Ari containing every right. So I would just basic my bracket here and in this Ari we put two different carries so well , first space. If I bracket inside this bracket and say one in the double coat Mama do in the double court just after that, when the first had a complete I would just be too by former here and space if I my second daddy. So I would just basic my bracket here and save one mama to mama treat. So now this Addy called are a containing right. Just after that, I will create one more added Mitro, 70 Constant at a port he's equal to. Now here we'll just create a non homogeneous Ari containing addict, right? So I would just basic five square bracket. And in the first index off the Addy, I will specify object. So I would just place by calibrates is here and specify to object properties like name daily Mama number 37 And here I would specify drama to specify second element. Now I will just basic by square bracket here on space if I two objects inside these areas. So we just are Carly vs specifying name. You don't yields on the subject, adding space if I comma two separate each element on spaces by my second object here rivals the name editorials on subject literal. After that, I would just growth this Ari using a square bracket, right? And in the statement fits semicolon this Harry known as non homogeneous Ari containing Eric . Right now let's take one more literal. So I will say constant at a five. It's equal to. And now here I would just create Ari containing carry on. We put function in this I so I will just base. If I square bracket here on on the first index, I will specify an object. So I will say General destitution Guam A videos 1 50 Right. Are we just basically coma here on 381 more Dari inside the carriage to create what mores face If I square bracket And after that on the first index off these Harry, I will declare a function. So I would say function on in the body of that function I will return so message So I would say containing function and just up for that I will create my second at element several spaces by comma here on, say, three and just close this alley with square brackets Right now you know that how to declare an addict the time is to understand how toe access These are elements. So here, if you want to go accent this added element, you need to specify your body needs with square bracket just like this 70 console dot Unspecified out of here. So I will say at once and in the square bracket, you need to space it by your at index. But how will you know which are a element has reached in the hasn't said earlier. How do you start with the little inverts? It means at a in them into one. Has Zito index at a element Do has one index at a element three asked to index, uh, at a element for all right. Three index value and so on. It means one has Brazil and ex prime new do has one index value three as to index value on poor as Kleenex. Right. So if you want to access these battered image, you need to specify its index value. So if you want to access the first element, you need to specify zero here, right? So I just facing by Zito. Just say I'm saved my doctor. Right, So you get one on the console. So if you want a toe ring second element, just corporatists want best in here and say one here to print second, other element to bring told Larry Element of just testified to here right and so on. You can paint all of them right? Using for look, you can print all of them at a time right now. Let's move on to the next day. Really true Now access the non ho engineers at an element. So it's a console, Doc. Law never specified the second at the name, So I will say at it too. And in the square bracket, I was basic by forced Index. So I would say zero here. So this would return Strain one. And if I just say console dark? No. How are they to and in the square bracket? If I specify to here, then this would return bullion value. True. Right, So this index will be done third element in the area. Now let's understand how to access the ari containing attic. So I will say console dark lock and specify my towed out of here and just access the first element. So I would say square bracket on in this great racket. I will specify zero index. Now you know that we have to carry inside this addict. So first basic by zero here to access my first Addy and to access the first element, I will create one more bracket here I was just declare one more bracket here and spaces by my first in there. So I would say zero. So when you execute these this portrait done String one Now back to the second Addy, you just need to specify one here. So I just wanted to called the first index off my second attic space. If I zero here. Right, So this will return one. This study is also known as two dimensional Ari. Now let's understand how to access two dimensional non homogeneous. So I would just basically I consoled our crop on I would just say had a four. And after that in the bracket, I was forced access my second at index using square brackets so I would space survives square bracket and say one to access my second air element Right after that, I just wanted to access these objects now toe active. This object declare one more bracket on a basic by your object index. So I will say zero here right now. You know that thes statement that it done object now to print object property value just face of my daughter operator with property name Vitis. I would just be a spy dot Here and say name. When you execute this, you get a name property value on the console. Right? Let me show you how to access the function. So I will just say Consultant Dr No, on just basic by adding five. And in the square bracket, I'm just basic 51 here to access the second element off my Harry And to access the function which is located in the first index. I would just basic by zero here. Right. So when you execute this, you will get a reference off the function now to call this function just face if I fighting thesis just like this. All right, so we knew. Execute these. You go get containing function message on the console. That's it. I hope you understand this lecture. 41. JavaScript Tutorials Serious Part 40: in this tutorial, we will understand how toe add on. Remove every element from the area so we will understand how toe are on remove added element at the beginning. Our end The beginning refers to the first element in the area which is zero on the end refers to the last area index which you can get using length minus one metal. So in this tutorial we will understand four meters that helps you toe are on drivel at a element from the area. These matters are false Bush shoot on unsheathed bush and quality are and we will respectively elements to the end off the attic Likewise on ships and ship are and remove respectively elements through the beginning of daddy. Now let's understand how these methods work Support? You have ari off numbers, so I will say constant a r r is equal to and in the square bracket I will specify at element so I will say to common three comma For now, you know that you have three elements in this parrot On zero index, you have to On first index, you have three on on second index, you have four value in the previous video, we learn how to figure out other index. Now, in this tutorial, I will show you another way to find out other index. So just say, console dot law and space. If I You're outta here now, on the console, you can see your area elements. Just click on this little icon. When you click on this icon, you will get your area element with its index. So now here, you can see on zero index you have to on forced index, you have three on on second index you have for right now. If you want to toe are any element at the end of Gary, then you can do this using push matter. The push matter will return the length off the Ari after inserting the area element, for example. So I will say console dark rock and just basic by my addy dot bush matter. I will just call Bush mother here and in the parentis is I will specify my element, which we wanted to insert in the attic, and after that I will just bring my array on the console. So when you executor days you will get adolescent on Ari. Now you can see five is added in the area element at the end. You are free to push any type off element in that it If you order to push string a, then you can push that puzzle like this. I will just remove this fight on here. I will specify a right now. If you want to remove the last element toe the Ari, then you can do that with pop matter just like this. I will just copy these two statements and here I will just pressed it on. I will remove the push matters and call for better here. Now, when you execute this statement, it will force sprained, remove element on the console and then bring the are you don't need to specify last element in the parentis is off park matter. It will automatically removed last element. So that right? No. Let's understand how shift and unchecked method work now shift an unchecked matter do the same job like push and pop method. But from the beginning, it means one shift and shift method will are and remove our element respectively through the beginning off the area just like this. So I will just base if I console dot law and call the ari dot unchecked better. And in the parent cases, I'm just basic by my at a element which we wantedto push at the beginning. Right on. Just bring the outta here. So the UN shipped method will are at element at the beginning, so you can see one is added at the beginning off that likewise shook matter will remove the area element to the beginning like this. So I will just copied these two statements and print here and just remove my gunship metal and just base. If I shift mentor here right now, you can see your first Ari element will be remote. Right? That's it. I hope you understand this lecture. 42. JavaScript Tutorials Serious Part 41: In this tutorial, we will take a closer look at slice on slice metal off addict. We will understand what is the difference between slice on spice Matter. But before we dive into this matter, I want to introduce Con cat matter first. Now you know that you can add and remove that element at the beginning on a day and off. Daddy, there is a matter which are multiple elements. Are Dane off that which is contract? In the previous lecture, we learned Bush pop unchecked on ship method, which can insult element and don't modified at now. The contract matter is a little bit different. Using on Capitol, you can insert an element attained off there. The first thing is, you can put multiple element after times this matter will return or is no addict. As you know, push pop and shift on ship Matter is returned. A new modified addict. Anyone? Let's take an example off gone cat method. So I'm just declared a simple numerical. I hear service constant. A R R is equal to on space if I feel elements, so I will say one do on a tree, and I would just bring this carry on the console Just after that, I just wanted toe can get this Ari and I just wanted to add 456 in this area. So I will say console dot law and specify my name. So I will say a heart are thought. I will call the Concord method on in the parent disease. I will specify 45 on six, right? So when you execute this dead friend this full return original Ari Rick modified element so you can see for five and six is added at the end of that Right now, let's head on to the main topic. Ridges sliced method. Now the slice matter used to return sub, adding, If you want you to slice Addy and get so body from that any, then this method is for you. Slice Method has two arguments. The first argument where the sub added, begins on the second argument where the sabbatical ends. When you are specifying arguments, you need to specify index value from where the sub Arab begins and where so very ends. This matter allows you to specify negative in. This is when you want to count your ad index from the end of that, for example. So we just create a new added here. So I will say constant they are Do you think will do and space if I feel elements so I will say one. Do bring 45 right now. Using console Dr. Ivan. Just bring Addie with slice metal. Seriously Control Dark law. Basic by my name. So I would say are too dot I will just call my slice matter. So I will say slice here and in the parentis is I will specify to here. So this pattern maker refers to the second index. It means these Addy start from the second index right from here tonight. So then you it's give this you'll get 34 and 500 console You're start for that. I was basically my second argument. Do the size matter? So I will say a are do dot slice on space if I do here where I want to start my adding on specified second argument that would specify for here where I wanted to end up my alley. So the fourth his report to the index value for it means the full is reports to the fifth element off that right. So when you execute these, you'll get three and four on the console Now, I just wanted to bring 500 council to print that. I will just say console Wroclaw on in the size metal. I will just put minus one so this slice metal start from the end and kiss will print 500 console. No, we have another matter which are on removed Our element at any position, which is supplies. Splice method allows you to do in place modification off the street. Using spice matter, you can add and remove that element from any index. Isn't it great? It is. When you specify an argument, the first argument is the index ready wanted to start mortifying on The second argument is the number off element to remove. On the Yemeni arguments are the element to be added. Right? Give that in your account, for example. So I was just declare and outta here constant they are three is equal to the square bracket . I'll specify one comma for comma fight now using spice maker. I just wanted to add do and three just after the first element, so I would just say a r R three dot slice meter. So I just called my slice method. And in the parent princes, I was basic fide. First argument one. I just wanted to modify this, adding from the first index, right? And then I was a survivor. Second index, which is zero zero, refers to none. It means I don't want to remove any element from this, Harry. That is why I asked Chris, if I zero here, if you want to remove any element, then you can specify 123 Are any value here just doctor, that I was facing two arguments here, which I wanted to add just after the first element. So I would say Do Mama three right on. Just after that, I would just bring this adding under control. So when you execute this, you'll get 12345 on the console so you can see here. I just added two and three element just happened first in next. Right now, if you wanted to remove any element, then you can do that also. Now, I just want to remove these two elements again. So I will just specify a r three. Not I would just call my supplies method on the parent is is I will just base. If I where I wanted to start, I would just start from the first index How many element I wanted to remove. So I just wanted to be moved to elements from the first Index. Sorry. Specify to here. And just after that, I will say controlled, outlaw and print this adding on the console. So when you execute these, this statement will start from the first index just after the fourth element on removed two elements from Barry. So this was the most two and three from very on print dreaming area under control. So you will get one for fight on the console, right? You can remove any element from any position in the area, but you just need to understand where you want to start from on. Very want to go under practice with these Adam occurs during practice. Will always help you to understand this. McCarville. That's it. I hope you understand this lecture 43. JavaScript Tutorials Serious Part 42: In this tutorial, we will take a look at a new litmus crypt six metres, which is complicating on film editor. So we will first understand What is the use off contributing matter? If I just wanted to explain the use off this matter then I can just say corporate within mental copy part often, Ari, to another location in the same area and return it. It means cooperating Method used to copy in carry on. All right, whatever element are they're using example you will completely understand what is the basic use off this matter. But first, let's understand what is this intact Off? Copy within method this index off copy within method is Addy dog here I will just call the copy everything method on in different species A copy of eating method takes three perimeter target start on end. The first parameter target is required perimeter The use off this perimeter is at which to copy the secrets to the negative value counted from the end. The second and the third perimeter are optional. The second perimeter used to specify at beach to start copping element from if peace perimeter has only did then the deport value will be a zoom as Zito, the end perimeter used to specify at which toe end copy an element from if this perimeter is for me there than the deport. Value as you too, are a dark blank. So when copy of it in Mentor copy and adding that the size off the area remains same, this matter would not change the size off Harry, for example, we just declare and numerical Ari here, So it's a constant they are our is equal to on. I would just base of our fuel elements. So I will say one Jewell 34 on fight right? And I would just call the corporate routine matter So I would say a r r dot on every Just call this copy teen matter here. So I was just a copy of 18 and in different places. I will fourth specify the first perimeter and then spaces by the second perimeter to and just say console dot law and print the ari under control. Now here the first index reports toe the index number where we wanted to start copying theory and the second argument space if I were wanted toe copy element from the second index. It means from the third Element. So this will print 13 for five and to complete the size off the carry, this will print fight again. Let's take another example. So we'll just get without these productor And here I would just say one woman, two on comma three. So in this statement, I would just start from the Post Index on a copy. Elements from the second index now here, we had specified told Perimeter also third perimeter used to space by very wanted toe end the copy from So it reports to the fourth element in the area. So these will just copy the third element two times and bring the remaining Arik right. Let's take another example. So I will just get rid off these parameters and say do comma zero. So we will just start this parrot from the second index on core Police vary from zero invites. So when you execute this, you will get 1212 and three under control, right? If I just face if I one comma minus one, we wanted to start this area from the first index. It means from the second element on copy all the area element from the end. Right? So the minus one repose toe the end off the body. So the output off this statement is 1534 fights, right? Don't just watch this. Tutorials keep practicing. After you practice on these matters, you understand what's going on on which thing is use where Let's move on to the next matter . Phil in Moscow six. Anu Mittal interviews, which is Phil, which allows you to get any number off element with a fixed value. In other words, film editor feel all the elements off the Ari from the start Index Toto end index with static values that syntax off this Middle East following. So just say Addy Doc. Then here we call the film method on this matter has three parameters value stock on and the first value perimeter feel ari with static rallies. The second and the third perimeter are optional. The second perimeter space If I were to start from and the third parameter space if I were to end up, for example So I will just declare an area here. So I will say constant they are one is equal to one do three for on fight. Right? And just after that, I would just called my field metals. I will say they are one. We just call my adding dot film editor And now in the parent places, I will just space if I value. So if I just specify a static de here on, just bring this area on the console on just say, controlled our love and say on Just bring this, Harry. Then the output would be this. So you will get five element with the static, the values right on. If you just aided this Param Eter space. If I second argument also. So if you just say comma here and Spacey 51 then thesis static values start from the first index because we space if I'd won on the second argument. So thesis static values start from the first index. So the output would be this right? And if we just specify the third argument also on, if we just say to here, then the output will be different. So the third perimeter used to space if I end off the static values means the first argument start from the first index and end on the third index So when you execute these, you will get one day D for fight on the pencil. Right? That's it. I hope you understand this lecture. 44. JavaScript Tutorials Serious Part 43: In this tutorial, we will take a look at Mac function. We will understand where to use it on how to use a map function in the program. So what is map function? Using a map function, you can manipulate each element in the object map function transformed element into Ari. Using the map function, you can perform any operation with specific element in the object map Function will not modify Ari, except it creates a new one and return Great. If this statement is or building for you, then let's take an example and get understand. What is the use? All my function. So I was just declared an added here, so I would just create a simple numerical addict. So I will see Constant. A R R one is a Jew in the square bracket. I will say one comma, too. My four. Right after that, I would just positive malfunction. So I will say Constant. I would just create available here and past the map function. Right? So it's a constant map. One music will do. So I would just call the out of here, so I would say eight are one dot I will just call the map function here. So I was a map on inter parentis is so I will just call at a function here, so I would just basic by parentis is on in the parent disease. I don't specify an argument, so I will say x here on then. Specify my adult. You can skip this barren places Also, if you're specifying only a single value in the argument, then you can skip this parentis is just base. If I the argument on the adult right, and just after that, we'll just have done a single statement. So I would say X, don't you fly by too? So they are not using the key word here because if you're using the John Cheever, then you need to space. If I calibrated and you need to wrap the turn on this statement in the Carly braces, right, so you can do the same thing like this also. So I will just specify X multiply by two will just multiply the variable by two here on return to the map function and just cause the's function as argument with a map Mitter right? And just after that, I'm just called my first addict So I was consoled dark talk and just bring my Eddie here and just offer that I will call the map variable so I would just say Consoler talk law on specified map one here, right? So the first adding is the simple declaration on the second map. Harry is modified at it, which is modified by my function. So when you it's a good the statement, you will know the beauty off Matt function. So the math adding returned by the map function is different. The math function will get each element in the area on Monday. Ply them with two. But how does this happen? If you're thinking that the map function does everything for us, then don't be in this misconception, because map function will just give us an access toe. Eat a element one by one, and we've done that. The whole thing is done in the map function parenthesis. So in the map function, parentis is we just specified a function which multiply a variable by two. So then the map function will get the area element on multiplied them by two. So the maps function will just assume that function argument as a area element on multiplied them with Do I return a new Ari horrors, Right? So when the map function execute its perimeter, then it will first get the element from the area, multiply them with two and return to the readable. All right. The one more used off map function is built during the adding you can use map function Topol. There are elements like this. Suppose you have a few throw rocks in the area. For instance, we will just take two products now recruiter, the product name and price. We will perform the following court. So I would just create out of here with two object element. So I would just say constant card is equal to on. I will create an arugula with square bracket on the zero index will specify. An object in the Calabresi is I will say product blacktop on Fridays. I will just basic fly a number value here, so I would say 55,000. Just after that, I will create one more element. So just face it by a comma here just for being closing curly braces and create one more object here. So I was just a product mobile on price he's almost 40,000. All right, so now I just want to return the product to the product Variable on price to the price video. I would just say priest people of name and product price in separate are so I will just create and constant variable here. So it's constant good up on in this valuable real store, all the product name is equal. Do I will just call my card away dot map function right now in this map function, I will just declare an arrow function. So I would just say x and space by my shadow on return deported name. So I would just say x dot product Right. So the map function will return the product name through the porters variable. Just after that, I will create a one more variable. So I was a constant price is equal to I would just call my card at a dot matte function in the map function perimeter. I will just say x spaces by adults. I'm just returned the price right using X dark price. Now we have two variables here. Product laying on the price we just wanted toe bring them on the console. So we just taken sold our law and print product on the rights right. Serving your ex securities. You'll get better at it. The product carry contains the name from the for up on the price, adding contained the price off the product. All right now, I hope you understand how to use map function and how to use a map function to perform such operations. That's it. The basic Jones editorial is completed. From the next tutorial, we will take advance topic of JavaScript. 45. Advance JavaScript Tutorials Serious Part 44: from this tutorial, we will start the advanced stopping off JavaScript. We will start from the object in previous lectures. We understand the basic off object on how declare an object with properties. If you want to watch that video first, then you can watch that video from the top right corner of the screen. After divorce. This video you will understand how to declare an object on how to access object properties . But now from this tutorial, we will dive deep into JavaScript on loan the advance topic off JavaScript. So will force quickly. Look at the bodies, object on how to declare them, and then we'll take a closer look at a difference between Harry and object. As I said in the previous lectures, Object is a container in JavaScript, which contains properties. You can also hold them. Aggregate are a complex data right To declare an object, you need to specify curly braces. Let's understand how to declare an object. So we were just overview the object video first, but I will just create an object here. I would just say constant LBJ music will do on the curly braces will space if I object properties so When you are creating an object, you need to space of, Eichel braces. So in this curly braces will face by a force property name strength on value 45. Now the first property is type up string on the second property value is type off number. You can put function also in the properties. We had learned that in the previous lectures. So now let's understand. What is the difference between Addy, an object in the previous lecture? I ask question. What is the type off addict? The answer is object. That is why we need to understand the difference between an object because it's also type of object. Now the object have two primary difference. Primary. The big difference between object and Ari is this. When you create Inari, it contains value index, New American. So if you want to access an array element than you need to specify at index, whereas when you using object, it contends, properties index five string our symbol, So if you want to toe access an object properties, then you can't use index values. The object probably can access with the property string are simple. The second biggest differences at a Our order using index number. It means zero index comes before the first index. Fred as object doesn't have this limitation in the object. It is not guarantee that object dot e has come before the object r p property. Right now this difference is quite confidential. Then what? Make object more important than in Eric In this advanced tutorial series, you will completely get Understand why we need to understand object because object are everywhere in JavaScript. Now let's create an object on print all properties on the console support if you have this type of object which has multiple properties like this, so I would just say constant will be J is equal. Do on will specify some properties, so we'll just say one. Hello? Do everyone at three Welcome four back to identify destitution. Now, if you want to toe print all the properties on the console than what would you do? Do you access all the property one by one to print undergone So our anything else? Let me show you the best way to train all these properties on the console. If you're thinking to use control flow statement, then you're right. The best way to bring all the properties of the object using for Indo like this. So I would just create important appear so I would just say for the parent pieces, I will create a let air in object. Right? So I was just base. If I obeyed you here and in the block, I've been just bring f right So this will bring all the properties on the console as simple as that. If you had the same idea to print object properties under control, then you are very clever. If you're properly following all the justice tutorials from the start, then this is not a very big deal for you to print all these properties on the pencil, right? 46. Advance JavaScript Tutorials Serious Part 45: in this do Toyo, we will take a closer look at a or B. We will briefly understand what is Oh, peace transfer on what is the use off or be in JavaScript? Don't forget toward the complete video because it is very helpful to you. 00 P. Stands for object oriented programming. To understand object oriented programming, we need to first understand what is object. Object is a simple on order collection off properties Peach Off, which has Benin on value object can aggregate multiple values on allowed you to store and access that values by property team probably name can be a strain are a symbol in the previous video relearn how to declare an object on in emirate its properties on the console . Now we'll understand. What is the use off object in object oriented programming? Object oriented programming is a very important aspect in every programming language. I really hope that you carefully listen all the instruction on understand what is object oriented programming in object oriented programming. Object is a logically related collection of data on functionality. Now, this object can be a collection off properties on matters using the real world example. You're completely understand how the object is really created. Now let's assume that off Jake is a car on a car has multiple parts on functionality. Now here we will assume car parts as properties on functionality as mater's. It means if the car has a model number, number of doors, glasses, number off wheels. These all parts are properties off the car object, whereas open door accelerate done on headlights on every functionality off the car, our metres off car objects. Now this piece of information will complete the car. It means when you combine car properties on matters, then you will get your complete usable car. So now the object also have the same similarity. Like car using properties. You can specify object part on using methods. You can specify object functionality. Now you know that toe build a complete car. You will need properties on matters right now here. I also wanted to introduce one more important topic. You can access object reference any time using the reference. It means when you specify your object reference to the other variable. Then you can modify this object using the reference raid evil. Using the example, you will understand what I want to say I suppose I have object on you. Have a reference off that object in the variable like this. If I just declare an empty object here. So I will just say constant O B J. I'm just basic fly curly braces here on this is my auntie object. And if I create a reference off this object so I'm just a constant why is equal to object then I can create properties off this object using this reference. So if I just say why dot the is equal to on in the double court, I will say property created using reference right on when I print this on the console. So if I just say concerned, outlaw and say o p j dot de then you will see the property off object is created So when you execute the statement, you can see your object has a one property created using the reference variable right? There is a lot more thing to understand on. We'll cover everything one by one. I hope you will have understood the meaning off object oriented programming. If not, then don't worry. Using future tutorials, you'll completely understand what it is don't forget towards the next tutorial because the next Victorio different spawned this tutorial. That's it. That is all for this Doria. 47. Advance JavaScript Tutorials Serious Part 46: In this tutorial, we will take a closer look at class. We will understand how to create a class in Javascript on how to use it. In the previous lecture, we learn what is object oriented programming. Now, in this lecture, we will explore a new topic class prior to eat my scripts. Six Creating the class is really fuzzy. It lasts six comes with the new convenient syntax off. Plus, like this class model. So the model is the name of my class. And then I will specify Carl embraces. And in this current graces, I will say constructor parentis is on the body off the constructor, right, This index create a new class model. So when you want to access modern class, then you need to create an instance off the class. No instance has been created yet, so we need to create a class instance first to access class properties and methods to create a class instance, we will just say constant o b. J one is equal to and just place it by a new key word and say model unspecified Parentis is old. So here we have created a new instance off the class, right you can create multiple instance off the same class just like this. So I will just say constant O B. J two is equal to new model, right? So O b j one a nobody to are two different instance off the same plots. So now we have two instance off the modern class renew, creating an instance off the class you need to use a new keyboard. A new cable will create a new instance off the class now, using over age of one and object to you can access object properties on matters. We did not created any properties and methods here, but we will look at them after a few minutes. But first, before we made the class sophisticated, I wanted to introduce you an instance off cable which tells you that which instance belongs to reach class. Now, if you want to to find out about which instance belongs toe which class, then an instance off giver helping out. For example, Suppose you have, ah, over. Give one instance off the model, plus on. If you want to know does over your one instance off the mortar class, then you can find out the answer using this so I would just say O b g one instance off. So this is the keeper. So I would just say instance off without any space and then specify my classmate. So when you execute this, you will get through because over the one it's instance off a model class. And what if I change the class? So if I just change the mortar class and say Eddie here, then you will get false right, because that is not an instance off a class. As I said in the previous lectures, you can create properties and metres off the class. Now let's make this cross more interesting. So here I would just explored the class in the constructor. I will specify two parameters, so I would just say AM number which is mortal number on. Then I will say a name which means more little name, right? And just after that I will say this dot M number is equal to AM number and then I will say this dot aim name is equal to m name. So this dot aim number on this dot am name is object properties on. We are assigning the value to the object property using the constructor parameter. We'll discuss these after a few minutes. Just after that, after the constructor completed, we would just create a meter. So we'll just say show on, then Specify. Parentis is just after that. Specify curly braces on In this method, I will just say consoled or crow and using the back take I will say model number this dot Aim number on Martin name this dot AM name, right. And just after that, I would just say Constant will be the one. Now here we have created an object instance So we just need toe specify perimeter for this object to access class properties and methods. Right? So well, first wanted toe initialized the class properties to initialize class property. We just need to specify perimeter for this cross. So I will just say by 50 on the name off. My model number is BMW. So the first perimeter is refers to the model number on the second perimeter report studio model name. So both his value assigned to the class properties model number and model name, right? Just after that, I will call my show matter. I would just say Oh, busy one dot show. I'm just basic by bad and pieces, right? So I just want to explain what we had done here. Now the constructor is used to initialize class properties. Constructor is a matter which invoke when the class instance is created. So when you create an instance off the class, you need to specify perimeter if you created constructor with the argument. So here in this example, we had created Constructor with two arguments. So in the constructor, we had base ified to argument when we created an instance off this class. All right, so we need to specify argument value when we create instance off the class. After that, in the constructor, we had used this giver. Now here, the Discover reports to the instance off the object in the constructor, we created two properties off the modern class. Using this cured in the previous lecture, we learn how to create a property using an instance. So here we are using this cure to create a new property off the class. So this giver is refers to the instance off the class right after that, we have created show may 3rd to create a method in the class you just need to specify metal name with parentis is and just after that, specify curly braces on the body. Off your matter. Matter is just like a function better is greater for adding functionality to your class. Right. So when you execute this, you will get your model number on your model name on the console, right? So using the class, you can solve any problem in programming. It is very important to understand how to create a class on how to use it. 48. Advance JavaScript Tutorials Serious Part 47: In this tutorial, we will talk about prototype. We will understand what is portrayed IV's and how to use a prototype in it must. Six. So let's understand what is prototype when you're referring to a matter that are available and instance off the class, you are refering to prototype method product. I performed dynamic dispatch using the prototype Gen Every function has a special property prototype for regular function. Prototype isn't used, but it is critically important for function in that act as constructor. Using this example, you will understand how to create a function which act as a constructor. So we'll just take a very simple example. So I will just write this example first on explain what we had done. So I'm just a leg. Uh, it's equal to, and I will create a function here, and in this function we create two properties using this diver. So I just said this dot a is equal to one. Then we'll create the second property. This dot Bi is equal to two, and just after that I will create an instance off dysfunction so I'll just let go. It's equal to new right and specify parentis is to call this function. And just after that I will create one more property using the instance So I would just say , oh dot de is equal to fight now I just wanted to create a prototype properties toe dysfunction. I shall just our properties in a functions using prototype Just see if dot prototype dot beat is equal to three and then I will just say f dot prototype, not see, it's equal to. For now, I have created see property here using prototype. So here we created a function and specified a reference off that function in the variable in dysfunction. We created two properties A and B. We had used this giver because we are creating an instance off this function using a new giver. So this function act as a object. So we specified two properties off A and B Just after that, I had created an instance off this function using nuclear So this function act as object constructor. Then we will create a property using instance often object. So, using the prototype, I will create two properties, right? So here I have just created be to inherit the be property on Along with that we have created see property also and specified some values. Now the important about the prototype is mechanism called dynamic dispatch. But what is the dynamic? Dispatch is well, when you wanted to access any property or method off the object. If it is doesn't exist, then JavaScript will check object prototype to see if it is exists there. Then if the prototype is exist there than the JavaScript will use that prototype property, I will show you how it's for. So if I just bring object properties on the console, then you will get very interesting output. So if I just say consoled oclock and print oh dot A So I will just bring my first property on. I just wanted to bring my all property here, so I would just copy invested here and just change or dot b or C on order deep. Right. So on the console you will get one do for and fight, Right? So now here you can see the be property is not inherited using the rhetoric because javascript will first check if the B property is available in the function or not. If it is available, then the JavaScript will bring the be property on the console. If the B property doesn't exist, then the JavaScript will print prototype value. Right? So if I just come in here to the B property on, run this program again, then you will get three on the console. Now here the javascript used the prototype be property, right? We are using three object properties and one prototype. So here, property, E B and D is its own property on the object on property. See, Is the prototype off an object? Now let's bring object on the console. So if I just bring this object on the consultants I was just consoled oclock on playing. Oh, Then you will see your object properties. When you click on this leader like on you can see your prototype properties. Just click on this proto property off the prototype matter. And here you can see your prototype properties. The prototype properly is invisible just like this. If you want to call the function, then you will say console dot law and say f here. No, I've been just bring the reference off the function on the console. So I had just base ified appear. So when I executor days I will get my function on the console Now. Here the prototype method is invisible. The same statement You can write with the prototype method also, so I'll just say consoled or clock dot prototype Right now. Here you can get your properties on the constructor function. Both steak main are saying in the Post statement. The prototype is invisible. Both statements that he turned the same properties and using the second statement, which has a prototype meter littered the constructor function. Right. There is a lot more to learn in photo type, but taking too much detail off prototype will overwhelming for you, so we will cover the prototype in the future lectures. 49. Advance JavaScript Tutorials Serious Part 48: In this tutorial, we will talk about study metters In this tutorial, you understand what is static method. Ease on where you can use it, So rescue started. Static meters are declare with static keyword, So whenever you want, so declare and static met her. You need to specify study before any method declaration. Static meters are declared with study keyboard followed by the name off your metal static meters cannot called on instance off a class. It means you can't access static meters for using the instance off a class. In the class declaration lecture, we had learned how to create an instance off a class on access properties and matters. But when you're declaring a static matter, you can't access it using instance off glass. Instead, static mentors are called using the class itself so whenever he wanted to call and static matter unique to call class itself right. Static metres are mostly used to create utility functions. We will understand what is utility function in future lectures, but just for now, consider the following example. So I'm just create a class here with a static method. So I would just say class, we will name this class static class metal space. If I curly braces and then in this class, I will create a static matter. So I would say, started on a call. This is my name off my static method on Specify curly braces here and in the body off the static methods have returned a message. Several say return. This is a static method, right? Just after that, I will just create an instance Offer class. I just wanted to show you when we will call the static mental using the instant what will happen. Right. So I will just create an instance Constant s t is equal to new study class metal, right? And specify parentis is just after that I will say console dot law and call the static matter using the instance. So I will just say s d dot on call. Right? So when you execute these, you'll get s t dot On goal is not a function. This is the other message, right? You'll get error message because, as I said earlier, static meters are called using the class name itself. Right? So if you wanted to call the static mentor, you need to specify your class name dot you're metal. Me like this. So you just get without this statement and say consoled Outlaw static class metter dot On call. Right? So using the class name, we will call the static matter. So now when you execute this statement, you'll get your message on the console so you will get this is a static matter on the concert, right? If you want to call any other static metal in the static maker, then you can use this giver also. So this giver bound to the class itself just like this. So if I just create one more static metal here, so I will just say static on call do. And here I will just redone. Ah, forced static mentor on a message. So using the back take, I will just call my first static method using discover. So I will just say this dot on call. And just after that, I was basic by my message, I would say called using another study method right now here I would just call both static methods using the class name just like this. So I'll just get rid of these first static method on here. I will specify my second static method, which is on call to So I would say on call to here, right? So when you execute this, you will get This is a static method called using another static method, right? So in this example, I had just used this cure to call static matter. But it's generally considered the best practice to use class name instead of using discovered because you can't access static matter in the non static method. So if you want to do call static mentor in the non static matter, then you can use constructor property. As I said earlier, you can't access static method using instance off a class. But now I will show you how you can execute static matter using the instance off a glass. We're not accessing static matter using the instance, but we are executing static mentor, using the instance right. It means you can execute static matter when the instance off a class is created, for example. So we just first get rid off these second static metal, and after that, I will create a constructor relearn when the class instance is created. Constructor automatically called right, so here I would just basic by my constructor, So I'll just say constructor parentis is. And in the curly braces, I will first called ecstatic matter using the class name. So I'll just a concerned outlaw study class Metter not on call. Right? So when you execute these, you will get your message on the console. So here, using the instance we execute the static matter, you could do the same thing with another state. Mental So So I just comment the statement and say consoled Outlaw! And here I will say this dot constructor dot on gold. So venue executive days, you'll get the same outcome because using the constructor property, you can call static matter in the non study. Mitter Right now, you don't need to call the static meter using the class name. It will automatically called when you create an instance off the class. So here I just created an instance off a class. We don't need to call this static method using the class name because it will automatically call when we created instance upper class because, you know, the constructor is called using the instance off a class. So when the constructor is called, the static metal automatically executed on print. The message on the console right 50. Advance JavaScript Tutorials Serious Part 49: In this tutorial, we will talk about inheritance. We will understand what is the use off inheritance in JavaScript and how to use it. So let's get started. So what is inheritance? Inheritance is a mechanism. Allow us to create new classes on the basis off already existing classes using the inheritance. But you can create child class off the parent class. Inheritance provided flexibility toe the child class to reuse matters and variables off the parent trust In JavaScript, you can use extent skiver to create the child class on the basis off parent class, using the extent cube, or you can acquire all the properties, matters and behavior from the in built object as well as the custom object. The date object is the proper example. Off in build object on the custom object is that which you will be creating using the class right, So we will just touch the basic example of inheritance. So, for example, suppose you have created a class off person with the first name and last name property. After you deploy this class, you want to add age to the person, but instead off mortifying the first parent class, we will create a child class which has an each property with a matter which display user name and age. In this example, we will create two classes Bannon class on a child flowers First, we will create person class and space if I first name and last name property. And after that we'll create second class Richie's each and space if I each property to this class. Right? So let's consider the following example. So I would just first create a class here. So I will just say class. But son and in the curly braces, I will create a constructor. You already know that toe initialize the class properties real yields constructor. Right. So you just say constructor and specify two properties here if name comma, ill name, right. And I would just initialize these properties with the property value. So I'll just say this dot name is equal to if name and this dart L name is equal to Ellen, right? So when you specify your constructor values, these values passed to the property. Now, just after that, I just wanted to bring the user name on the console with their age, so we just say class, age and here I will use extend giver toe extremely parent class and then specify your parent class name. So I'm just pace. If I person here, right? Using the extent you are, you can reels properties and metres off the parent. Russ. Now, just after that, I will specify curly braces on here. I will say constructor and space if I one argument. So I will say azure on just after that. Here in this constructor, I will call these super mentor right. So super paren thesis on here toe The super matter will specify two parameters. Harry, the first name off my person on Dean. The last name off my person. Right? But first, what is super mentor and what the super method does? Super Matter is used to call the parent class constructor Using super matter, you can pass perimeter toe the parent class constructor and call them. We will call the parent class constructor using Super Mitter on space if I values to the perimeter right, So this matter will call the first parent class constructor right now. Just after that, I will create age property and specify assignment operator with my parameter variables, right? I just wanted to bring the person first name and last name and their age. So I will just create a matter here. So I will just say show up. So this is the name of my method. And in this matter, I will say consoled Outlaw, I will just first call the first name. So I just wanted to specify this dot If name I will concurred Innate this value went place if i some space between first name and last name and then call my last name property. So I was just that this dot l name Just after that I will say consoled outlaw on base. If I message using the back take, I will say your age Ease on here. I will just bring fine age property. Sibel said this dot Age Now you can see here we are accessing the first class properties on the second class properties in the child class, the benefit off the inheritance that you can reuse all the properties that matters in the Charlie flowers. Right. So here you can see we use eight name on the last name using only discovered. We don't need to create any instance off the class and anything right now. Just after that, using the child instance, you can call any property and mentor off the parent class. This is very important now. Inheritance will help you to call all the properties of metres off the parent class using the child Cross instance just like this. So here I will just say constant and the is equal to new age. Right? So here we are not creating a person class instance we are creating an age class instance here right now here I will just place if I parentis is on specified 23 year. So this is my age. Just after that, I will call the shop method using the instance So I will say d dot show up on Spacey five pattern distance. Right. So when you execute these, you will get your person name, first name and last name on their H. If you wanted to bring person name on the console, then you can do that using the child class instance also like this. So I'm just a concerned our clock Be don't evening. So here you can see we are accessing the parent class property using the child class instance right? This will print the first name on the console right now, if you are not using inheritance on, if you're just using the two separate classes without using any extend world without using any inheritance, then you cannot access any properties and metres off the class without specifying its instance. 51. Advance JavaScript Tutorials Serious Part 50: In this tutorial, we will learn prototype inheritance. In the previous lecture, we learn the class inheritance. Now we will take a brief look on prototype inheritance. In the previous lectures, we had learned what is prototype on in that video. We had learned a small example which tells you how to create a prototype. If you don't know what is prototype, he's Then you can watch that with your first and move on with this tutorial. Well, you know that object Have a special hidden property prototype and JavaScript will access this property if the property and method does not exist. Suppose you specify a property to the object and want to access that property. If this property does not exist, then the JavaScript will move to the prototype and search for that property. You had learned these in the prototype Pretoria, right? Using this example, we will understand the complete concept behind the prototype inheritance inheritance provide reusability off properties and metres off existing objects. In the previous video, we learned the class race inheritance. Now, in this tutorial, we will understand prototype inheritance. To save the prototype, you need to specify prototype property proto using the proto property. You can sit and get properties and metres off the prototype that's constructed for living Example. So if I just create an object here so we just let car is equal Jew on here We specified two properties Real four on model Dessler on. After that I'm quickly eight bike object here So I'm just a let bike is equal to And here we just place if I only one property So I will just say cc 2 50 right now Just after that I will just space if I prototype property off the bike object So I will just say bite dot on here I will call the proto property So you just need to specify underscore two times and say proto here and then again space If I underscore right And I would just bring the bike object on the console. Let me show you the prototype property first. Here is your prototype property. Now let's access object properties on print on the console. So if you want to toe access by property then you can just say consoled outlaw bike dot se See Right. Using the statement, you can access your bike property. Now we know that you can access object properties on matters using object name. But what if I say you can access the car object using the bike object also? Yes. You heard it right? You can access all the properties and metres off the car object using Divi captured like this. So if I just say here consoled out now and say Bike Darcheville And then I was just a bike dot model then this is not an invalid statement. If you're wondering, how does this happen? Then let me tell you that we had specified a prototype property off the bike object. So when the Javascript executed statement, JavaScript will first take the object own properties if he does not find any existing properties there than the JavaScript will look at the proto property off the bike object on , utilize it Now Here you can say car. It's a prototype off bike object and you can also say by proto typically inherit the car object. So if God has more than two useful properties and metres, then you can access all of these properties and methods using bike object. So these properties are automatically every level for the bike object Such properties are call inherited, right? If you have a metal in car object than this matter would be available to the bike object also like this. So if I just create a matter here in the car object so I will just specify comma here and say show So this is the name off my mentor. And here I was just a console dot log on space if I a message So I just used tactic and say car model these dot model on space by coma here and see have this dog wheels on Savile here right now using the bike object, you can access this matter so I will just say bike dot Show on specified fab intestines to access Dementor. Right, So you can access the car object matter using the by culture. Now we know that what is prototype inheritance? Let me tell you what is prototype chain. Now, suppose if we have one more object here, so we will just get rid of these statements now in the bike object If we just face if I photo property off the bike object and if I just say here total car on After that, I will create a bicycle object here and just say, let by cycle and in the carnivorous is I will specify one property. So I would just say Gear five now here will just place if I buy cycle prototype property. So I'll just a protocol, Mike. Right now here is your question. Can you access the car Mitter using the bicycle object? Yes, you can. Using the prototype, Jane, you can access any properties and metres off the object, so I'll just say bye cycle dot Show on. After that, I will just print this by cycle on the console to display the prototype Jane. So when you execute days, you will get message on the console. This is all happened using the prototype. Jane, let me show you. Here. You can see the gear object has a prototype property on the prototype property has its own program property. You can create number off object properties. Jane, as per your vision. Now, using the bicycle object, you can access any properties and methods off car on bike, right 52. Advance JavaScript Tutorials Serious Part 51: in this tutorial were alone. JavaScript, poorly Marxism. We will understand what is polymorphism based on how to use it, So let's get started. Polymorphism is a core concept, often object oriented paradigm that provide a way to perform a single action in different forms. This provide an ability to call same method on different JavaScript objects Using polymorphism in object oriented programming, you can create variable metals on object that has more than one form. The use off polymorphism in javascript is toe override property or matter if you want to toe alright any property or method in the parent class, then you can do that using polymorphism, for example. So here, if I just create two classes here and extend the coast class, some just create a parent class here. So I would just say class and bloody. And here I will specify my constructor. So I will say constructor and space if I my perimeter So I was a name here on in. It's like my perimeter with this dot name is equal to name and just after that I will create a matter here. So I would just say employees name and then say here, console dark rock and just bring the property on the console. So I would just say employing name this dot name right now. Just after that, Using the child class, I will just extend these parent class right? In the previous lecture you learn what is inheritance is all about using the inheritance. We will all right, different class of matter just like this. If I just extend the parent class here. So I will just take class member extent employees. And here I will just say constructor and pacified to arguments. So I was just a name on salary and I would just call the parent class constructor. So I would just a super. And in the Parenti sees I will specify my constructor parameter. So I would just say name here, right? And just after that I will initialize both properties. So I will just say this dot name is equal to name on these dark salary is equal to salary. Now here we want to toe. All right. The parent last employee named Metal here. So I will just space if I the same name for the child class metal also so just say employing name Valenti's is on here in the curly braces, I will say console dot long I will bring message. So I would say employees name this dot name on salad E These not salary. Right? And just after that, we will access this class object and methods using the class instance. So I will say constant and be is equal to new member, right? And in the parent pieces, I will just specify two arguments because we had specified two arguments to the constructor like so when you create an instance, you need to specify perimeter for the class. So I would just say Neil Patel. So this is the name off the employees on salary eases 35,000 right? And just after that, I will Just using the instance, I will call my employees name metal, so I will just say and be dot employees name. So when you execute the statement, you will get your message on the control employees name on his salary. Right. You can see here we had specified two metres with same name. So the second child classmethod with all right the parent last matter. You can also notice we are accessing both class mater's using a child class instance. Now suppose if you wanted to execute the parent trust matter then just come in. This child matter are just changed the name off this matter. So just coming This method on execute dates again. So you will get your employees name on the console. So this time Javascript will execute the parent. Last matter right on. If you just change the name off the child Classmethod, then also you will get the same output, right? You can all right class properties also just like this. So here I will just add one more property. So in the employ class I will just add one more property. So I will say this not age is equal to 24 on All right, this property in the child class and I would just added this property in the child class with a different problem. So we just said this dot H is equal to 30. So we will all right. The parent property in the child class, right? And at the last I will just specify this property in the message. So when you execute these child class property will all right, the parent class property, the important thing to notice is if you want to toe alright any property, you need to specify same name for both properties and you need to inherit the parent class now. I just wanted to explain one more topic, which is string theory presentation every object ultimately inherited from object. So the meters available for object are vital. Fall available for our objects. One of those matters is too. String Does string method provide the default strictly presentation off the object. Having a two string matter that say's something descriptive about an object. For example, I will just create a date object here. So I was just a constant day. T is equal to new date, right? And just print this date on the console so I'll just say consoled Outlaw day tea. And just after that, I will print this date on the console with two string better, so I will just say consoled outlaw DT. Thought to strength on specified parentis is because this is a matter. So when you execute these, you'll get your date on the console. But what is the difference between the both outcome? I will show you now let's bring the same statement with the type of keyboard, so I'm just a concerned or claw type. All de de dart the string and say console dark log type off DT So when you execute this, you'll get string an object on the console. So using this statement, you will understand. Using the two string, we are converting our object into string. The basic use off to string matter is to convert object in tow, string time, right? 53. Advance JavaScript Tutorials Serious Part 52: In this tutorial, we will understand new topic in Moscow six, which is maps. In the previous Javascript lectures, we had learned the basic concept behind the maps, but now we will explore the map topic and understand maps in detail. So let's get started. Enigma Skip six, a new data structure introduced, which is math map it just like object that they can map a key to a value. When you need to map a key toe a value you will turn into object because object allows you to map string case to object values off any type. So then why javascript need to introduce a new data structure? If you wanted to map a key to a value, then the object has some drawback. The prototype will nature off object that there could be map ings that you didn't intend. As you know, in object key must be it's involved or string this nature preventing you from mapping object to a value. And also there are no easy way to know how many map ings are there in the object. And you also know object do not guarantee any orderto their properties. So the map object address this Cassity the map of object. Hold key value. Pair on. Remember the origin insertion off the keys. You can use any value as a key or value in the map. You are free to specify any type of values like remaining are object when you want to do space. If I keys are values, toe the map to get size off the map, you can use the size property. Now let's understand how to create maps. When you want to create a map, you need to understand. Two metres first set on get said Mentor is used to set the value for the key in the map object and get matter is used to return a value. Associate it with the key undefined if there is none. Now let's take an example and understand map object Well, so we'll just create a map object here to create a map object. You need to call map constructor Soto Call constructor. We'll just say constant. My maps is equal to new map. Unspecified patent. This is right. I just opt for that. I would just create Let G string is equal to Andi. Specify string type. So this is the type of string Mama Qi object is equal to object So I will just places like olive presses here. So this is type of object on space. If I comma here and say key function is equal do function on specified curly versus here. Right? So we have created three variables forced variable each stream second variable is object and told Babel is function right now. Just after that, I will said key and value to the map object So I'll just say my maps dark. I will call the segmental here. So I was set on specified Mikey. So here I would just say key strength. So I was just placed by my first variable name, Roma and space. If I value for Disc E so I would just say gay string value Just after that, I would just copy this statement and pink here and just change the key. So I will just specify key object and the value these key object value. I would just praise the statement again and say hear key function and value is key function value. Right? So here we had said key and value to the map object. If you want to do know the map object size Then you can say my maths dot sight. So here, you just need to specify your map Instance on space if I size property, right? No, I just wanted to print the map object values on the console. So I will just say, consoled out, lock my maps dot Get so here I will call the get matter to get the T values. So I'll just say get G string. I will just copy the statement and print here on just change the key. So I would just say key object and just print it again on here. I will say G function. So when you execute these, you will get your key values on the console, right? So I just wanted to show you you can use not a number as a key, also just like this. So if I just say my maps not said and if I create a key and rally appear here, so I would just say not a number. So I would say in a n drama on, I will specify a value, so I will say not a number. So this is a valid statement. I will show you How so? If you check the not a number type, then you will get a number on the console right now, I would just get the value off the key, not a number. So I will say console dot log My maps don't get not a number, right? So when you execute days, you will get your not a number key value. Now let's understand how toe it turned the map object using the form below you. Can ETrade map object just like this? So I will just say for and in the parentis is I will say let and here wanted toe trade key and value. So I will just specify key Guam a value on just after that sea off on space. If I your map objects, I would say my maps right. And in the block, I will say console dot lock and I gonna add a message on the console. I will specify back peak and say map key on space if I g here in the curly braces mama value on specified value in the early presses. Right. So when you execute this, you will get your map, teas and values on the console right There is another way to declare map object the map object have relation with Addie objects So you can specify any in the map object also just like this. So if I just create another map here. So I was just a constant new map. Its sequel chew New map on specified parentis is now in This parentis is I will specify and out of here. So I would just face if I a square bracket And in this square bracket I will space find my Addy on the first index I will specify Inari So I will say bracket here and say one comma, String one and just after that's basic by my forced index daddy Then I will say to Mama string to and then specify second and exciting Cree Mama three strength right now I also wanted to show you If you want to toe treat this Ari, you have one more way to it. Read this area just like this Just basically your map object Instance. So I was just saying new map dark for each. Using forage matter you can eat rate all the properties in the map object, right. So I've adjusted for age and in the bracket I was placed five function and specify two parameters values on keep. So here I wonder toe e trade values and keys on the control. So I will just basic values and key as a perimeter on in the body. Off this method, I will say consoled, outlaw, specify map key. And in the curly braces, I will say key specified value. And in the court reverses. I will say value right. So when you executive days, you'll get map properties as simple as that. 54. Advance JavaScript Tutorials Serious Part 53: In this tutorial, we will understand what is weak map. In the previous lectures we had loan, what is a map is all about? Now, in this lecture, we will explore the week map. So what is weak, man? The week map is identical to the map object, but there are treaties, parity between maps and weak maps. First Rick Map G must be an object. Second week map cannot be created or cleared. Kote Ke In week map can be garbage collected right support. You have an object that is a key in a map. JavaScript will keep that object in memory as long as the map is in existence. But not so with the week map. The week map is a target to the garbage collection because off this treatment cannot be created are clear. If you're not family with garbage collection, then let me introduce the concept behind garbage collection. Garbage collection in JavaScript perform automatically, and it is invisible to us. The garbage collection. Take care off memory management in JavaScript support. You have object and this object has two properties. The first property can be accessed with the reference, and the second property doesn't have any reference to access it. In that situation, JavaScript will put some junk data in the unbridgeable property This property value called garbage value, Right? For example, suppose if we create an object here. So I would just say Let user is equal to Andi. Will space 51 property here? So I would just say name daily, right. Just after that, I will put this property on the console. I will say concerned. Outlaw user dog a name right now. What? Even the space If I know to the user object just like this. So I will just a user is equal, you know, And just bring the name property on the console. So I will just be consoled. Outlaw User Dark name now, Joe Oscar feel put garbage value in the name property. This is all happened behind the scene right now. Let's move on to the main topic on understand how to create a weak man object. The most important thing is weak. Map is used to store private key in the object. Instance. For example, if we just create a week map here, so I will just let weak man, it's equal to New Week map right. So we just call the constructor off week map using the new Cuba. And just after that, I would just create an empty object here. So I will select or B J is equal to car reverses. So this will create an empty object here just after that. Using the set cured will specify key and value to the week map. So I would just say week map dot said And in the parent, this is a real force base for Mikey. So I would just say, Oh, BJ here on then space if I value so I will just say private here and just after that will specify but more key and value to the weak man. So I was just a week map dot said O B G one on space if I value private data, right. So if you want to access these value, you can say week map don't get using the get matter. You can access values using the key. So I was just to get on space. If I will be your here. So when you execute this, you will get your value on the console, right? As simple as that. Using this example, you will think that why we need to use a week map if we have a map object to do the same thing. Both are similar. As I said earlier week map store object as a key on this key is private. You can't access this key without knowing it. So suppose if you don't know which key you specified in the key, then what will you do? One example Now, if you want to toe access this key we can use for off loop on, Get the key on the console just like this. If I just create a four off LaPierre Sorry. Just before on in the parentis is I will say, Let I had a square bracket on spits bikey for my value off week map. Right? And I will just bring this key and value on the console. So I was just a controlled outlaw key on consoled outlaw value. Right? So when you execute this, we expect key and values on the console. But this is not going to happen. When you execute this, you'll get a type of a message which say's week map is not a dribble, right? So this means you can't access key off the week map. It is private, so keep that into account right 55. Advance JavaScript Tutorials Serious Part 54: So in this tutorial, we will understand state object. In the previous lecture, we had loan. What is awake map? Now, in this tutorial, we will understand the concept behind the state object. So let's get started. The state object is identical to map object, but the state object allows you to store unique values off any type. It means state. Object is a collection off data where duplicates are not allowed to create a state object. You just need to call the set off Jake constructor just like this. So I would just call the state object constructor here. So I will say Constant S t is equal to new set on specified mantises right now toe are elements in the state object We have our matter using the emitter you can our element in the state object just like this. So I gonna s t dot r and specify your element. So I will just basically I one value in the state object. So I will say one here to add another value. Just call the arm attar again. So I will say s t dot Do right. So this will add to values in the state object if you are trying to insert the same values again, then said object would not insert this value in the collection because state object only store unique rounders. So if I just add the two value again, just like this s t dot R two and the state object will not insert these value because we had already inserted to in the state collection, right? You are free to specify any type of data in the state object like this. If you want to do inside object in the set so you can say S t not are. And in the college races, you can say a colon one mama B colon To so using this, you can add object in the state collection. There is another way to declare state object just like this. You just need to space if I Addie in the state object constructor. So if I just add in addi here so I will just say swear bracket and specify values. So I will just basic by some values, I will say one comma, two comma, three for my poor and here ever specified duplicate values. I will specify four here again, right? So when you print this, you will get only 123 and four. You will not get duplicate values. The set because said is not print duplicate values. It only accept unique values right now to know whether the element is present in the sec or not, You can use has matter using the has matter you will know which element is present in the set. Collection has matter. Build returns true. If the element is present in the collection or return falls just like this, if I just say s t dot has and specify element So I would just say four here then region value would be true because we have four in the state collection And if the element is not present in the set object, you'll get false on the console. So if I just specified five year, then you will get falls on the console right To deliver the element from the set, we have delayed method also like this s t dot till it and specify your element in the parenthesis. So I will specify four here. So when you print this set object on the console, you're gonna see the fourth element is deleted right. Do we treat state object you can use four off Luke are for each local So like this. So I will first e trade this object using the forum looks I will say far I end up paren thesis. I will say Let item all s t So is D is my set object Instance And then in the curly braces , I will say consoled Outlaw Andi specify I don't really able here. So this will bring said objects collection on the control. Okay, there is one more matter to e trade the set collection using for each look. So I will just say s d dot for each on in the parentis is I will call the arrow function So I would just basic five my argument So I will say value here on space If I adul on in the curly braces, I will say consoled outlaw value. Right. So this will also print said collection under control right now Let's move on to the next topic Weeks it in the professed lecture we had learned what is wheat map? If you had not watched that video, then you should watch that first on. Move on with This lecture, the week said, is identical to a weak man. There is no difference between weeks. It on feet map except their declaration, Weeks said, follows the set. Object principle on weak map follows the map object principle weeks It is collection off objects on the object is unique in the weeks ahead. Collection the weeks it can only contain objects on the objects contained, maybe garbage collector values. In weeks, it cannot be traded weeks. It is rarely used object in the JavaScript. Now let's consider the following example. So if I just declare and weeks it here, so we just wanted to call the constructor off the week, said class. So I will just say Constant W s. It's equal to New Week said on specified parent. This is just after that I will create two objects here, so I would just let o. B. J is equal to cuddle process. So we are creating to empty objects and just say comma full is equal to curly braces, right? So this will create two empty objects. Just after that, I would add these objects in the beak ST object. So I was just a W s dot ad and specified My first object in the parentis is so I will just say object here. And just after that I will add my second object in the pattern. This is right. So using console dot log you can see we have two objects in the week set right now to delete these objects. You can use Dilip Matter like this so I will just say ws dot daily and in the parent Racists I will specify food right on. When I print days, you will get only one object on the console because we had a deal it 81 object from the week set night to know whether the object is present in the collection or not. You can use has matter also. So if you just say W s dot has on space, If Aiyar full object here, then you will get falls on the console because we had already deleted full object from the weeks that right 56. Advance JavaScript Tutorials Serious Part 55: in this tutorial were alone. Exception handling. We will understand what is the use off exception handling on how to use it. So let's get started. Exception handling is used to write every program exception. Handling is a mechanism which comes about to deal with error in control. Fashion when you want to to save your program from unwanted air messages on convert that error messages into a native language than the other handling will help you out. In JavaScript, we have try and catch block to handle JavaScript errors the syntax off try and catch block . Is this so here? I would just start my fry blocks. I will say dry and in the curly braces. Here's your statements, and just after that, I will create catch Block with parentis is right, so these parent pieces will take argument right and then face if I curly braces on the statements in the syntax we had created two blocks first is try block and second is cash flow. The first try block will always execute. You are free to space. If I only one statement or multiple statement in the try block right. The catalogue will only execute when any exception are you can say errors. Of course, it means when you execute your program, the try block will first execute. And then if the try block throw any better than the cash block will execute and perform statements in the cash flow. For example, if I just say try and in the try block, I will just say console dot law and basic by a simple message. So I will say, Try block on in the catch block. I will specify my perimeter. So I will say here, E right. So this is my perimeter and just wanted to print this perimeter on our message under console. So I will say concerned, or clock catch block later on space by your perimeter here. So when you execute taste, this statement will not execute catch block because the try block will not throw any better . If we create an editor in the try, block that, let's see what will happen. So if I just create a variable here, which is not defined, then let's see what will happen. So if I just say here, variable and specify Sim colon So this variable is not defined. And when I execute these the cash block will execute and print user defined error message on the console. You can specify any message in the catch block to determine your error message. Now the few things you need to note before you use. Try catch. Exception. Handling your cool must be a valid JavaScript code because try and catch block work for trend time later. Supports. You had specified closing square bracket here. So if I just space if I hear a closing square bracket, then the cash block will not execute because this is not a runtime error. Now you know that this is not a valid JavaScript core, so you will get an error message before become pilot. Now, if you want to describe your error message more profoundly, then you can use it in object also, for example, so if I just space if I a batter meter here, so I would just say Eat are you can specify any Batterman tourney for the catch matter. And here I just wanted to describe my air message using air object properties, so I will just say console dark law, e r r dot message. I will just copy this statement and bring here and just remove the message property and call name property here. And I would just based it again and call stack property here right? You can specify other names also toe the air object. So here we had specified three properties off other object name property which returned a name off later. Massive property, which returns only an error message and stack property, will return current call stock Right now. Suppose we wanted to execute a few statements after the catch block execute. In that situation, we have finally broke. Also, the finally block will always execute. So let's see how it's work. So I will just create a final block here just after the catch block. So I will say Finally on in the car embraces I'll specified console got law finally execute . So when you execute this, you will see the final block executed just after the error messages. So whenever you wanted to execute any statement after the error message, you can use finally block also, that's it. I hope you understand this lecture 57. Advance JavaScript Tutorials Serious Part 56: In this tutorial, we will learn a regular expression. We will understand how to use regular expression in JavaScript. So what is regular expression? Regular expression is a powerful way to searching and replacing inside strength. It means if you wanted to replace our search any string or pattern, then you can use regular expression. Regular expression is mostly used to search a string, or if you wanted to replace anything in the string in that situation, regular expression will definitely help you out. There are two ways to implement regular expression. Using a long syntax and short syntax, we will first understand using the long syntax. So to create regular expression, you need to call an instance off The regular expression object like this regular expression consists are pattern and fly. So when you are specifying argument in the regular expression object, the first argument is a button on. The second argument is flat. Let's consider the following example someone just say Let Craig. So this is the instance is equal to new on. I will just call regular expression class, so I will just say rate E XP. So here you don't need to specify the whole name off regular expression. So just say break E x p and in the parentis is say pattern. So this is my first parameter mama flag on. This is my second parameter. We will understand this pattern and flags soon, right? The second way to create regular expression is using slashes like this. So I'll just stay here. Wreck expression is equal. Chew on space If I forward slash pattern and then again specify part words last year Now if you want Toto reply, you can do that also just do the same thing And just after the forward slash here space. If I your flight right now let's understand how to use it Suppose if you want you to search daily world in the string then you can write this type Of course So I will just write a string here So I will select str on in their double court. I will say welcome to Delhi to Shin now I just wanted to search a daily world industry. So in the regular expression, we are specifying string pattern right. So I will just let Ray is equal to new regular expression on in the square bracket here. I wanted to search my daily word So I will say daily here. Now, using the search mentor, we will search the daily word in the street and the search matter will return a world index Numbers starting position the string start with zero index like an air element. So I will just say here consoled, outlaw and in the parenthesis I will say str so I will call my string. Don't such so I will just call my search mental to search the stream on specify a regular expression instance here. Right, So when you execute these, you will get index numbers starting position off your word. You can do the same thing with short syntax also So I will just get rid off this instance off regular expression on Dhere gonad let rig is equal to and here I will just specify forward slash daily and specify forward slash again. How did you escape? No disease. A regular expression. You know this is a regular expression We are using forward slashes. So the javascript will take this statement as a regular expression, just like a string which we specify in the Devil Court. Right. So this will return the same outcome. I personally suggest using the short syntax when you're using a regular expression. But if you want to be use variable as a pattern, then you need to use long syntax for that. Now you know that we are using pattern to search for a specific world in the string. But what is flight on? Let's understand how to use it. Regular expression have fight type of flags, flags allow for global and case sensitive searching. These flags are yout separately are in any order, for example, so this is your stream. So if you specify the regular expression world in the capital letters and let's see what will happen so if I just space If I hear Capital World Daily on, execute these, then you will get minus one on the console. So the minus one at a first do not found it means a regular expression. Can't find this world industry to solve this case Density Word. We have flags like this. If you just space. If I flag just after the pattern like this, if I just say I hear and when I execute this again, this will return the world index number. So the flag used to search case sensitive words. There are fight type off flags in the regular expression, so the I flag used for kids sensitive words di plank usedto global search in flag used for multi line search you flag used for unique or street pattern as a unique or sequence and the last be flag used for sticky search that matches starting at the current position in the target string. There are plenty things to do with the regular expression. To cover everything in detail. We need to start a new tutorial cities on regular expression. If you're interested to learn regular expression, then you can commend me. If I get a lot of request from you, then I will definitely start this tutorial cities soon. That's it. I hope you understand this basic concept behind regular expression. Let his own for this tutorial. We will see you in the next round 58. Advance JavaScript Tutorials Serious Part 57: In this tutorial, we will understand what is the dome? We now move to the JavaScript as used within of a browser commonly called client side scripting. Whatever we have learned so far is legal. JavaScript. Goal From now the future Few tutorials will depend on the dorm scripting, hoping that you know the basic office, Timo and senses. So we will move forward with the dome scripting using HTML and CSS. You can create a static, informative way. Pages on this bridges can be called document Using John script. You can really make these videos dynamic Using the Web browser rather than working on the text, you can use graphical interfaces. These pages might dynamically lower information as needed, so we will first understand what is Don't Dome stands for document object model. According to the document object model, all attacks in East email is an object. The text specified in the tag is also an object. So all these objects are accessible using JavaScript. Conceptually, don't is a tree. A tree consists off notes. Every notes has parents are zero or more child notes. The route, nor is document has only one child. HTML. The estimate element has to Children's title on head. The following is the don't treat You can also call estimate as a root element in this don't tree We had to child notes Hey, on body using root element you can access all the child knows in the head, nor we have title and in the body we have HTML elements. It depends on you what you put inside the body on in the head. If you put anything in the body than the browser will create a child or a body element on, you can access this note using the Don't agree to understand Don't re in detail. We need to learn from the example So we were just create a simple example here. So I will just create a simple html snipper. So I would just basic by any exclamation mark here and just enter. So this is our simple HTML document. I will just remove unwanted there from the female document we have dr Types de Mille. Hey, tidal body on in the body. We have paragraph of it demo text. Right. So this is your simple esteem ill snippet. So in this example, we have a good element. HTML and the root element consists off to child knows hate on the body in the head We had title with the title fixed on in the body We had paragraph with demo text You can access all the text on all the html tax using the don't tree to understand how Don't really look like Just turn your document on right Click on the document and say inspect So here on the elements top you can see your don't agree So in this don't re we have a root element esteem ill By clicking on the tax you can extraordinaire your country like this You can extend your don't re by adding multiple attacks in the body or in the hay off this gym A document In the next tutorial, we will understand how to access this. Don't read in the JavaScript. In the next tutorial, we will understand. What is the use off? Don't object. And what can you do with this object? That's it. That is all for this tutorial. I hope you understand this lecture 59. Advance JavaScript Tutorials Serious Part 58: In this tutorial, we will understand how to access document object model using JavaScript, and we will also understand how to manipulate dome elements. In the previous video, we had learned what is don't is all about. Now let's understand how to access a document object model elements, So let's get started. So when we started learning John Escape, we had learned how to import JavaScript in the HTML file. Using script, you can use JavaScript in the East. Email using Skipjack are You can import JavaScript file using the source. Attribute off cryptic. So when we import your script in the East email, you can immediately begin using FBI for the document. Our window. As I said in the previous lecture using JavaScript, you can create a dynamic pages, then what you can do with the dome object Using dome object, you can change any estimate elements on its attributes. Using dome object, you can create new estimate elements with its attribute, and also you can remove it. If you want using dome object, you can add and change ceases styling off the pitch dome object can react all the event in the HTML page on you can create our change any event in the weapons, so don't meet the standard object. Morial on programming interface for estimate The dome object defines the estimate element as object, and the dome object also defined properties off HTML elements on metres toe access. HTML elements on also event for HTML elements. So basically you can do everything with estimate elements using document object model in the document object model metals are action. Perform on a stimulus Elements on properties are values which you can change our set, so we'll first understand they don't programming interface. As I said in the previous lecture, all estimate elements are defined as objects in the programming interface. Property is a value which you can get or SEC on. Matters are action performed on the East. Email elements like billeting and HTML elements are creating a new one. Now let's take a look at the example and understand how to access estimate element using document object model so the commonly used to access a Stephen Deliverance is using a method called get element by Heidi. Using this matter, you can access any HTML element in the dome tree. You can also change any HTML text all specify a new text using JavaScript using dome inner HTML property. You can sit or get any value off the female element. So let's consider the following example In the previous video we had created this dome dot html file. So in this file in the body section, I will just create an empty paragraph here on specify I d battle and just leave this batter up as it is now using this, I d. We will access this paragraph using the JavaScript. But first we need to link my mean Dodgers pile using Scripture to used gasket in the HTML, you need to first link your javascript file. So the html document you can you javascript in the html also. But we are using external JavaScript file to maintain my JavaScript court separately. So I will just link this file. I would just say script on space. If I attribute source on in this attribute, I will just base If I'm I mean dot Js file Right after that in the main door Js file. We will write some court toe access the paragraph and specify some demo text. So I will just click on the main Dodgers pile and here So in this file are just a let Venna is equal to So this is my variable on now I will just first call my document so to call the document we have a document object So we'll just say document So this document object refers to the current document and then I will call the method off this document objects also a dot get element by idee As the name implies using this matter you can get your element by its i d So I will say get element by i d and in the parentis is I will specify para So this is my i d Right now we have a paragraph in the patter variable Let me show you the paragraph on the console So I will just say console dot long and specify batter here. Right, So this is your paragraph So this method will return paragraph to the pad Upgradable. Now you have your paragraph. Now we want you to space. If I text to this paragraph to get content often element you can use inner estimate property As I said earlier using inner HTML property you can get all set text today estimate element. So I will just say sarah dot inner html is equal to So we just said next to this paragraph on in the double coat, I will say this is dome tutorial. Right. So when you executor days, you'll get your text on the document. This text will not print on the console. We're not printing this text on the console. This text will print on the document because we are using a steamer, right? Esteem? Oh, all tax our print on the document. Just after that, you can do the same thing with JavaScript chaining also. So I will just say document dot Get element by i d and space if I my batter here, which is the i d off my paragraph Dark inner is Demel and specified my text here. So I will just say this is don't Victoria. We will understand what is javascript Jenning in the future tutorials. But just for now, we're just creating a chain off methods and properties. So when you execute days, you'll get the same outcome. You can do the same thing with get element by tag name method. Also the get element by tech name matter will get the element by the HTML tag Ning, just like this. So we just let b is equal to document dot Get element by that name and in the parent thesis , I will specify beat right? When you print this on the console, you'll get your paragraph object on the console. Right? So when you execute this, you will get estimable collection object and this object contained paragraph You can access any estimate element using JavaScript. That's it. I hope you understand this lecture. 60. Advance JavaScript Tutorials Serious Part 59: In this tutorial, we will understand Document object, Moral CSS selector. In the previous video, we had learned how to manipulate estimate element using document object model matters. But there are much more gentle matters that you can locate element and not just by i d our tag name, but also by the relationship to daughter Element. Now, in this tutorial, we will take a look at two metres off document object First Grady selector and then equity selector off. We will understand each method one by one. So let's get started. We will first take a look at credit selector matter. So in the HTML document, we will create a simple development with the class Deve. But right in this division back we will create two paragraph So will first create a paragraph one. So I will just say paragraph So I'm just basically be here on tap on just basic by class, batter up. And just after that I will create another paragraph with I d right. So I was just a p tap i d is equal to batter one. Right. So we want you to space If I unique I d toe the paragraph So we will specify Batter one here. Now, using query selector, we will select the paragraph and specify some demo text using inner estimate property. Grady's Electra matter returned the first element that matches the specified ceases selector. In the document, it means the queries director only redone the first paragraph on specified text using in our estimate property. Now, I will just open my main door Js file. I will select a paragraph using query selector method. So I will just let Vera is equal to document dot Grady selector. So I will just call my query selector method. And in the parent disease I've been called the paragraph using a CSS selector. So we will select the paragraph using the class to select your paragraph using the class you need to specify class name with dot operator. Right. So I will just say dot here and specify your class name. Right. So the query selector used to select ceases selectors. So we'll just say dot batter here. Right, Let me show you the paragraph on the console. So I will just specify console dot law and say para here. So this method will only return one paragraph. Suppose in the dome Got estimate file will create one more paragraph with the class para Then this metal will not select the second paragraph because this matter only return the first matching element in the document. Now, just after that, I would just specify inner estimate property and specify some devil text to the first paragraph. So I will just say para dot In our esteem, ill is equal to paragraph right now, Using query selector, you can also select your estimate element using a tag name. So if I specify only be here in the greatest selector, then this is also a valley statement. So if I just place if I p here that the result would be same, right? You are not limited to space. If I tag name our class name in the query selector. But you can also specify a unique I d to access external element just like this. So you find just space. If I hear hash fat out fun, then this will return the same outcome. So now here we are accessing the paragraph using its I d. So when you really want to toe access paragraph using I d. You need to specify hash before the name off died. Right? So basically using credit selector, you can access any HTML element by class. Name, tag, name are using i d. Credit selector is a CSS selector which allows you to select estimate element like CSS electors like you can select HTML in the Caspian style ship to specify styling to your estimable filaments, Right? If you're not familiar with ceases, then make sure you first understand, says a selector, and then move forward with this tutorial. Now let's understand what is quite a selector all so query selector all mentor is identical to query selector method But instead of returning only one element, this matter will return all the matches element in the document that matches all the specified ceases selector, for example So in the main dot Js file, I will just get rid off these statements and here I'm just create like Farrah is equal to and here I will say document dot ready selector all don't forget to select the right method . So now we are selecting quitting selector are now in the parent disease off this matter we will select the paragraph using classmate so I will just place if I dot here before the class name and specify my class name here. So I will just basic five para here, right? And I just wanted to show you what this metallurgy turn. So I will just say console, not law and specify patter here. So this method will return a note released object This noticed object contained two paragraph now to access any paragraph in the note. Elise, we have square bracket in this normalised. We have collection off notes to access this nose. We have index number using index number. You can access any nor in the note least object like this. So if you want to to access the first paragraph, then I will just say para and in the square bracket I will spent 50 to select my first panda ground and then specify dot Call my inner estimate property and specify some demo text. Right? You can do the same thing to select the second paragraph also but just changed index number . Now you know the difference between equity selector on credit selector all matter in the next tutorial real access estimate element and specify some styling 61. Advance JavaScript Tutorials Serious Part 60: in this tutorial will understand how to specify styling toe the HTML element using JavaScript. So JavaScript has a special property to specify styling today. HTML element Just like ceases style property. I love you to specify different styling today. Stable element In the previous lecture, we had learned how to access element using query selector on queries. Lecter all matter now, in this tutorial, we will take a look at style property off the document object. So let's get started. As you know, style property. I love you to style your element. Therefore, we will directly jump to the example to understand how this property work. So in don't dot html file, I would just create a simple some great Britain here. I would just say input type, submit on specified class sub mate, then in main door jails pile. I will just select the submit button using credit selector, so I would just elect so he's equal to document dot query selector on In the parent cases. I was specified double code and say dot submit. So I will just select the separate but only using class name. Now let's see how to style your submit button using JavaScript. Now, when you specify a new property today live in, then you need to careful about one thing when they were you specify property. You need to specify exact property name because style properties are case sensitive, for example, So if I just say here so dark style, dark background color and well spaced by background colors, I would just equal to. I need a double court. I will say black. So when you execute this, this property will apply to the element, right? So whenever you specify any styling property, you need to keep in mind that every property start with the small. Later on. When you combine two worlds like background and color, then the second world should be. Start with the capital later, right? So if you specify a small later here, then this will not specify background color to the submit button. Right, so the JavaScript will not recognize this property, and therefore you will get your default background color to the element. Now let's take a look at Phil styling properties off JavaScript, so we'll just change the color off the button, so I will say so. Dot style Dark color is equal. Do right then I would just change foreign sites. I would say so. Dark style dot Phone size is equal to on in the double court. I will say the e m on the last I wanted toe space it by patting also so I will say so. Dark style dot batting is equal. Do 1.5 a m In JavaScript we have more than 50 properties to change elements styling. But now we have another matter to styling your estimate element using CSS. So to do that, we need to create a class in CS is sorry First removed it last name from the submit button right on in the head. I will create a ceases class so I will just create a style attack here on in the style attack. I'm declared a class submit. So we just say dot Submit on in the curly braces. I will specify feel Caesar's properties. So I would just say batting one e m earned four year Then I was basically by foreign size one e m background color black on the color property, white smoke right now in main door Js file. I will just get rid of these pigments on here. I will just say let So it's equal to document dot query selector. I will just call query selector matter on In this Grady selector, I will select submit Burton using input type. So, as you know, Grady selector is a series of selector to select PR element. So I would just say input on in the square bracket. I will say type is equal to submit. So here we are using import to select submit button right after that Want to tow our CSS class using JavaScript so toe act this class we have classless property using classless property. We will access our matter So the emitter will apply CSS style to the element like this. So we just called so dark. Last leased property dot ad meter on in the parentis is I will speech by my ceases last name. So I would just say some right here. So when you exit your days, your submit button would be changed. Using this matter you can are any ceases, class, toe The element this matter is really helpful when you are working with event toe our class toe the special Rick element on even fire 62. Advance JavaScript Tutorials Serious Part 61: In this tutorial, we will learn how to create a new estimate element using JavaScript. In the previous video, we had learned how to access snores using credit selector on how to style them well in destitute area. We will understand how to create new nose using JavaScript, so let's get started. Until now, we had learned how to access Knowles using document object The advantage off using dome in the JavaScript Using JavaScript, you can create your own notes explicitly to create your new dome element. You have 38 element matter using this matter. You can create your new nor explicitly this matter only create a new node, but it doesn't add it to the dome. You will have to do that in the separate step. Now let's understand how to create a new north with JavaScript, for example. So here reveal create two paragraph with some demo text and then a pain. This paragraph in the division talk So in the dome got html file. We will first create a division tack with the class, so I will just say thief class content, right? And just after that, in the main dot Js file will create two paragraph So we'll just say let B one is equal to document dot Create element writes I will just call my create element matter On in the parentis is off This better I will specify my tag name which I wanted to create. So here I wanted to create paragraph So I will just say be here right to create second paragraph I would just say let P two is equal Jew document dot Create element Be right Just after that I wanted to specify some demo takes tow this paragraph so I would just use text contained property off the document object So I will just say even dot text content is equal to so I would just call text contained property off the document object on space If I some demo takes to the first paragraph just after that I will select my second paragraph So I will say p two dot text content is equal to and space if I someday motorist here also So I would just say second paragraph here. So when you execute days this will not do anything because we haven't added this paragraph to the room. So to do that we have a paint child matter toe insert element in the dome. Ah, pain Child matter used to insert a new old toe The end off the list off the Children offer specified partners So what you really want to toe insert in the dome? You have to space. If I parent known first and using the parent node, you can append your child knows now to upend this paragraph in the division type, you need to first select the division time so I will just say constant contained It's equal to and here I reposed select the division using the class name. So I will say document dot equity selector on using the Kuwaiti selector I will select the division time so I will just say dot contained Right So this statement will select the division time Just after that I will just append the paragraph in the division time So I would just say contained dot upend child method So I would just call up in child matter toe are paragraph in the dome element So I would just say a paint child and in the parentis is I will specify my paragraph right, So I would just say even here just after that, I will up in my second paragraph also. So I will say contained dot a paint child. Be too right. So using this method, you can append your child in the division tax. So when you execute these, you will get your paragraph in the division time. Right? Now suppose if you want to tow a pen, this paragraph in the body, then you can do that as well. So I will just come in the second paragraph and here I will say document dot body dot a pained child and space If I my second paragraph here. So this will appear in the second paragraph in the body section. Right? You're not limited to create only paragraph in the dome. You can create any estimate element using create element method. So it means don't gives us full control off estimate elements. So what if you want to do space? If I attribute to your arrest even elemental in that situation you have saved at rebuilt matter using this matter, you can say value to the specified element. If the attribute value exists, then only value is updated. Otherwise, new attributes is added with the specified name on value. For example, If I just wanted toe specify class at rebuild to the paragraph Then I will say even dot said attributes on in the parentis is I will force specify name off the attribute. So it's a class here on the value goes to the second perimeter. So I will say Caroline here. Right. So when you had secured these you will see your class on your class name through the first paragraph Right now, If we just change the value, then only the value is updated on the name off. That rebuilt remains the same, right? If you can add the attribute toe the element, then you can remove attribute as well to remove attributes we have removed. Attribute matter, you can remove attributes value using attribute, name like this. So if you want to toe remove your class attributes from the first paragraph, you will say even dot Remove attribute on in the parentis is just base. If I your attribute name here. So I wanted to remove my class attributes. So I will say class here. Right. So when you execute these, you're active, you would label Basically there are lots off method in the javascript that you can use improper circumstances right 63. Advance JavaScript Tutorials Serious Part 62: in this tutorial, we will learn. What is that? Our attribute. If you have a basic understanding off HTML, then this would not be different for you in esteem. Ill. You can specify data attributes using data name along with the name off your data, so it means any an tribute on any element who's attribute names. Start with the data is a data attribute. Suppose you have any limit on you? Want to to store some data for extra information that doesn't have any visual re presentation In that situation, you can use data attribute like this in HTML. You can specify detail tribute today element. So I will just create navigation back here and say class now bar and specify to data attributes. So I will say data number Zito and create my second attributes. So I was a Daytop name now Bar light, right? So we had created to data after boot here. Now, if you want to re use any extra information in your JavaScript program, that this data attribute will definitely help you now. Suppose if you have to navigation menu with same class and if you wanted to access the first navigation menu with their name then the data attributes will help you like this. So I'm just created to navigation menu here. I already created my post navigation menu Soldiers Cooperative First direction menu and paste It Here and just genuine desire to root 21 on the data name now are dark in maine dot Js file I will just force select my navigation attack using never close So I will say Let now is equal to document dog Pretty selector all I will just call queries director all metal and in the Parenti sees I will say dot now bar right using the class name real access navigation time using the class name In the previous video, we had learned how to set attribute to the element using state after route matter Now using get attribute maker you can give the attribute value You can also get the data attribute using get attributes method You can get any attribute value using this matter just like this. So I will just say console dot law and in the parent pieces I will say now I will say like my first a navigation menu using the next number So I will say zero here and say Get attribute on in the violent disease I just face if I name off my attribute So I will say data number here to access my second navigation menu Active route. I will just copy the statement bested here on Just changed in navigation menu index number two. Right. But when you access your attributes using get attributes mentor, you need to write the score too long to solve this problem. You have a data state property using details it property. You can get attribute value using after boot name to read the data Attribute. We have data state property to get the attribute value specified Data state property dot the name off your data attribute which you have specified just after the data name like this I will just say console dot lock on inter patent cases. I will first select my first navigation menu. So I will say now on in the square bracket ever space via zero to select my first navigation menu and say thought data said on Specify your data attribute here, So I will just say number here. So here you just need to space about your data name. You don't need to specify the complete name off your data. Activate here. So we'll just say number here. Right? So using this method, you can access your both navigation menu number. Right? You can do the same thing with the second attributes also, so I'll just copy the statement and placed it here on Just changed the number two name. Right? So, using the statement, you can access both navigation menu attributes. Now, you know that how to use the data property to access data attributes X Now, I just wanted to introduce a new useful property in javascript, which is class name using class name property. You can get our set value off the class attributes after specified element. You can specify your class name using string. To specify multiple classes, separate your class names with spaces, for example. Now, in this example, we will create toggle class function this function toggle to classes with the flag variable like this. So we just first create a paragraph in the dome dot html file. So I will just say be class is equal to toggle, right and specified some demo ticks. So I will just say color these text right and create two seasons classes to change text color. I will just go to the health section off this document and say style on Just create a style attack and just say dot double in. So this is my first class and specify color property light Cora. And then I will just create my second class dot duggal out on space If I property color light blue right now, Just go to the main Dodgers pile in this file Billboards get rid off this all statements on I would just say Let Thiago is equal to document dot Quickly selector and select your paragraph with the class name I will just say toggle here right now Just stop for that. I will just create an anonymous function here, So I will just say let color is equal to function on. I was just pitch by an argument flag here on in the body of dysfunction. I will create a P and l statement. So I will just say if I would just basic fly my flag variable name here. So I will just say flag on in the if statement, I will just say toggle dot class name is equal to Thiago in So when? If condition become true, I just wanted to specify double in class to the paragraph. And when the condition become false in the else statement, I will say Tiago dot last name is equal to toggle out, right? So when if condition become true, I would specify talking in class to the paragraph on If th