JavaScript From Scratch For University and School Students | Muhammad Ali Yasin | Skillshare

JavaScript From Scratch For University and School Students

Muhammad Ali Yasin

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
21 Lessons (1h 32m)
    • 1. Introduction to JavaScript

      2:37
    • 2. Introduction to Variables

      6:47
    • 3. Finishing up variables and introducing constants

      5:11
    • 4. Where to put Javascript Code and How to code a Button

      4:02
    • 5. Javascript Fun Tutorial

      1:49
    • 6. How to get user input using prompt

      5:29
    • 7. Introduction to Arithmetic Operators and Assignment Operators

      6:59
    • 8. Introduction to Comparison Operators

      4:59
    • 9. Introduction to DataTypes and Logical Operator

      5:03
    • 10. Introduction to If Then Else Statement

      5:11
    • 11. Introduction to Else If Statement

      2:12
    • 12. Introduction To Functions

      5:15
    • 13. Introduction to Switch Statement

      4:57
    • 14. Understanding Function Libraries

      4:23
    • 15. Introduction to Variables Scope

      3:06
    • 16. Introduction to Arrays

      2:12
    • 17. Introduction to Loops (While Loop)

      5:24
    • 18. Introduction to For Loop

      4:21
    • 19. How to Print Page

      2:01
    • 20. Create Live Digital Clock

      4:19
    • 21. How to Make Random Colors Effect

      5:13

About This Class

This course is aimed to teach university or school students the basics of JavaScript, anyone can take this course if they want to get a good grasp of JavaScript Fundamentals. This course is awesome because it was created with the help of a friend of mine teaching at university and all the exercises in this course are the questions that came in university's exams. And i promise you that at the end of this course you'll be comfortable programming with JavaScript.

Transcripts

1. Introduction to JavaScript: you're west of guys, Osama, and you can vote him to JavaScript. You're number one in this. Sure. We're going to understand what is javascript. Then we're going to download a text editor for writing JavaScript. Lastly, we're gonna write a simple hello our program. So let us get started. First of all, what is Javascript? John Script is a program language that allows you to make your wreck pages more interactive . Which basically means JavaScript allows you to do more than just displaying the page. It allows you to create buttons and do stuff with those buttons. Let's take an example for this. So we have a bulb in here. If I click on turn on, it will turn on the bulb on. If I click on turn off, it will turn off the boat on. That is all because of javascript. Similarly, if you go in to calculator, as you can see, this calculator can also be made using JavaScript. Also, you can make simple but awesome games using JavaScript. You can do a lot of stuff in it now let us actually download attacks, editor because I think this is enough as an introduction, the text editor Alan be recommending is not but trespass or brackets or sublime tax. You can download any of them or good. I'll be using brackets. Suppose the video and download any text editor off your tries. Bye bye. I hope you're done. Now graph folder on your desktop and name it learning JavaScript as you can see in here and now, open your text editor. I'll be using brackets, as I said, and from here, I'll add the new folder, which I created that it's got learning JavaScript. So if I come in here and I see that it says learning JavaScript in here. So I opened it. There is nothing inside Now that this create a new file, I'm going to right click and create a new file and I'm gonna name it index dot html Well, right side. We're going to write to skip tax the open script that on the closing Scripture and inside this, we're gonna ride Document. I tried and hello world and we need to put a semicolon at the end. We're gonna run this. It says how the world now let us understand the program. The document basically means the webpage on right means I want to write. What? Hello word. I want to write hell over on the weapons. And this is our weapons. That is all. Okay, guys, That Fordice a trail. And also in an extremely bye bye. 2. Introduction to Variables: us of gas. Um, I like, um, welcome to Jonah. Scripture number two in the story A. We're going to learn how to that comments and what are variables. So let's get started. First thing first, let's create a new pile. And let's name it term, too. It's up to you. You can use the previous file inside. Here it Let's add script that's and inside this let's write document. That's right. And in hair built hello World retreat credit and the last material to make sure everything is working on. If we come back in here and refreshed is, you'll see the thing is working. Why? Because this is a different paint. So you need to re opened this and it says Hello, world. Now what is a comment? A comment in JavaScript is used to add information about the court, such as what the court is about, or to add reminders for yourself. What driving? Bella? Let's say I want to write a comment which says this is ah, hell word for them. The way I do it, I had double for slashes. After that, I say this is Ah, hello, World program. No, When you add doble for re slash is and you write something in front of it, the compiler or the browser will ignore or neglect this tax, and it will not try to understand it or will not look at it at all. It was. Just skip this tax and goto this stacks directly. You can even change your court to a comet just like this Now Computer will not look at it because it most whenever there is there are double slashes. It will not look at it at all, whatever it is. Okay, But if you have most people alliance, what do you do? Well, if you have multi lions or multiple lands off comments, you can add slash Asterix and the point where you want to close it will say a strict slash means Anything in between this will be considered a comment. Let's put an alert. Heller is just a pope, and let's say inside it, I love cookies on I said this and come here and refresh this as Agencia Pope comes and says , I love cookies on it did not interfere with the comment, but if I leave this as you can see, it converts. The alert also into comment. And if I try saving this and refreshing this, it will consider it a comment and it will not bring this. Let's go to inspect and let's go to council. Let me do this. And if you go in here, it says this is a comment. So there is nothing to run, so make sure you close it with Asterix and Slash or former Slash. Now let us understand. Variables. What variables? What are variables? Verbals are basically containers that can contain value. That I suppose I have a variable called X on It contains value. Holy So the variable X is a container that contain value holly, And by the way, they are also known as named containers. Because thes container have name the outside can have like my love equals. For example, let's say Sabrina. So she's my love. Okay, now we have a variable on variable X contains really, really horrible mile of contains separator. I can create something like this. I can say, um, on if I place and right acts, it means I want the value after I am aren't of value off acts and the value of X is honey. So if I say this and come and refresh this. It says I'm Ali. Okay, Good. Plus mean. I went after that. What do I want after the island on? I love bless my love. And so if I save this and come in here and refresh this again if I after I have done with this, it says are Molly and I love separately. Looks nice. Like it, By the way, when you declare very about means when you create a verbal started keyword far again, this is a variable. So you started keyword bar. The browns are understands that it is a variable. So even if you don't put this, it will understand that this is a very well. But it is a good practice to put bar because we can directly see it is available. And it is easy to read on. By the way, I forgot seven Clinton here. So I will set this again. Don't come and refresh this. I'm Ali and I love Sabrina. Okay. Is this the only reason we used rebels? Actually, there are a lot off reasons and one off The more simple reason is repetition. For example, I have created a program I was asked by my boss to create a program which will be the buyer later off someone. So let's say document took right his name ISS. Then after that, we need his name so accessible it's his name. And let us suppose we have 100 lines off it. Similar to this about this guy, I only have four. So I go back to my boss and let me comment this out and tell him that I'm finished with the program. And he's like, Oh, I meant not Ali. I meant George. And I'll be like, What? The f is this? Come on, you should have told me. I have created 100 lines for this. And now you're telling me this is George? But this using verbal is easy. Just changed here because variables are changeable. We can change value of verbal during the execution of program. So if I save this on, come back in here and refresh this. This is Miami's George. His name is George. His name is George. Story says his name is George. And so on so forth. You can add even the are in here and save it and come back and refresh this as you can see Copias in here. Okay, guys, that was old for this tutorial. And I'll see you in the next drill. Bye bye. 3. Finishing up variables and introducing constants: You're lots of guys. That's American. Welcome to Javascript To number three. In the future, we're going to learn the rules for naming variables. Then we're gonna have a look at Constant. So I ask a started, As always, let's create a new file and name. It's trigonometry. Trail number three dot s TML. Let's great a simple s Kimmel document on. I'm gonna name it. Tutorial three is right on in the body. Being in the right script. That's and I'm gonna actually get rid of this. So before starting, let me tell you that variables are also named as hide identifiers. I dont fires on for naming, identify IRS or form naming variables. We have to for some rules. And those rules are number one. Names can contain letters, digits underscores or dollar signs. What do I mean by that? Is var If I say my name, it can contain so very by my name contains letters, right. So it can contain also digits. No problem. It can contain underscore. No problem. It can contain dollar sign. No problem. This is dollars. No problem. It won't cause any problem. But you can no start with the number you can eat. They start with a dollar sign or on the school or a letter. You can no start with a number. And the second thing is that this war, my name and the war my name are different things. So if you like my name, for example, it's a George my name Ali on If I colored these one off these, let's say my name. I have two of them to our 1st 1 that is Ali and I'm safe, tres and renders and let's see what happens. As you can see, it's Ali. And if I write the mining, which starts with capital letters on, save it on that coming here and refresh it as you can see it, says George. So it's case sensitive. He is sensitive. Sense that and you cannot use the reserve. Er cannot use the reserve words. I mean, come on, we have something called constant Right cones are confirmed or console, so I cannot save our console. It's incorrect if I said Bar Council, it is incorrect because the council is a reserved for it. So all those reserve words like these you can know adduced these I cannot say attribute or array or alert. I cannot say, For example, let me try. I'm gonna save our alert because our name in here I'm gonna say alert, okay? And I'm gonna save it on, and I'm gonna come and refresh this. It's not gonna run if I right click and go to his practice element on Goto council. It says Allard is no a function at three. So you're saying he's saying that this is no a function? The seller is Nora function, Miss. It has to be a function. You're not using it as a function. Therefore, it is an error now similar to variables. We have something called constants. What? Bones? Tents. Constants are basically similar to very both that they are also data holders or containers that can hold data value. But the problem is they are constant. They cannot let us suppose I have. Ah, Constant called my okay for exam pie at that equals 3.14 on the alert pie. The other fight. So we said fine on, actually, let me coming this out. Andi said this and we come here and try to refreshing it as agency it's despite treatment. 14. No problem right now, I change the really If I as a pi equals 3.15 on, I learned it out. And now if I try and refresh this after I'm actually okay and try and refresh this it says 3.14. It doesn't say 3.15 on. As you can see, it also shows me and her. So when there is enter, it shows the previous result. If we go to council use also see, there is a problem assigned to constant variable. It basically means you have you tried toe assign some variable to constant Some you try to change this value so constant cannot be change. Okay, guys, that for this trail and also in the next real bye bye. 4. Where to put Javascript Code and How to code a Button: your loss of guys Osama, I think unwelcome to Java script during them before in decision. We're going to understand where to put JavaScript code. How to create external JavaScript file at how to call a button. So that's get started In HTML. Jascha Court can be place either in body or in the head section or both. Let's place it in the hat section first and in here. Let's ride inside alert at section Oh, I forgot the teeth now in the 40 section. Let's right at one. My pitch civet on Let's go the folder and double clicking here and you'll see that there is nothing in here on when I click on OK, you will see my homepage appears so it's basically like this. The script Rinse first on when you click. OK, the rest of the page will be displayed. No, actually, let's take this court in here and let us put it down. And from here, we're going to say my portfolio page folio page on in the alert. They gonna say body section and let's sit this when it come back and try clicking here, you will see what happens is this will change to my first for your page, My poor father Page then the body section or the script rents. Okay, Now we understand that we can put our script act either in the head section or body section , and we understand how it's going work. But Jonah script itself inside html doesn't look like a good thing. So what we can do is great and external JavaScript file. Let's right click in here and create a new friend and they're gonna call it G s Testing door Jazz Js means there's a JavaScript file now in here. I'm gonna write L'Art on. I'm gonna write Js Testing is working. Okay, Wrong spelling. I know, but let's just go read now Come back in here instead of all this court in here and we're gonna I'm gonna take this out on right. A simple script, cat. Let's suppose this is a simple step back inside the first script on I'm gonna write source ongoing type Js testing Georgie s and I'm gonna save Now let's refresh this. And as you can see, it says Js testing is working. The attended stripped or ex terrifies. We're done with that. Now let's understand about the button you create a button on. We actually let me close this after everything and it's called Click on Me. They save it and come in here and refresh it. As you can see, there is a button I can no do anything when I click on it. So what I want is when I click on it, Armand and alert books to appear also own Click means that when I click on it I want and alert books to compare. As you can see, I'm using single courts on I'm saying I love cookies again. I love too much. Please. I think on and then put temple on I'm gonna say that on coming back Refresh and clicking here As you can see, I love cookies But if you want some other court to trigger or toe be ah, run or to run Basically, you can just change this to that court, for example. I want to document dot right to contend there Are you people on a I said this. Come back in here and refresh this When I click on this, it says, Where are you people? Okay, guys, that was old for this trail and I'll to in the next real by my 5. Javascript Fun Tutorial: Hello, Anderson. Guys, welcome to dysentery and in distributive. You're gonna have some fun that javascript so less get started. What I'm gonna do is I'm gonna give my catch one, and I d I'm gonna say I d equals what's a ah, each one? No problem, right? It's an I V. So what I'm gonna do is I'm gonna say document in the document inside our pace Don't get elliman by hiding. I'm going to ah, refer to some element okay? With its idea and what is idea? The idea is that you want What I won't do is with this idea I want it to I was time. Andi means CSS dot i want its color to change. What color do you want to help? I want tohave. Let's say red and then I'm gonna see Ah, Senator Ellen and I'm since this. Let's come in here. Let's refresh this. And as you can see, it shows me Welcome to elephants, troops and ready. So what if I want to access its tag rather than its I d. What kind? Well, it's easy again. You can say it took human. Don't get element by tag. Name on in here. You put the tech name in double course That is H one. And you will say that I'm accessing the first such one on. I'm saying chanted style too Backer and Toller and change the background color too Korean. Sure enough, right now, if I come in here and refresh this as you can see, this is screen OK, guys, that must old and also in the next trail. And don't forget to practice this thing or learn about this thing. This is really or something, and you can do a lot off stuff with this. Okay, guys, that result on Barbara. 6. How to get user input using prompt: you're What's up, guys? A cinematic welcome to jobless gift to remember five industry. We're gonna learn how to get user input using from so Alaska started. A prompt is a dialogue boards which allows us to display text books for getting user input . Let's have a look at it. That's right. Drunk. An insurgency prompt has two parts. The message part and the value part. What are these? Let's first write it and then we'll understand the message. Part will say a message. And in develop art music veiling part. Maybe on I'm gonna try displaying this. Now What we get is this The message part is the message at the top. And the value part is this part in here. So let's try this. I'm gonna change us toe for a message, Harto. Let me save it and then come back in here and refresh this. And as you can see, enter your name. Your name goes in here. Okay. There are two points to notice in here. Number one, this is optional. We're gonna get rid of it. And if you save it on a comeback, refresh As you can see, you just directly type in here And you don't need anything in here, right? It's not needed. So it's optional. Second thing is, you can actually do without this, too. So if you don't write anything on, come back and refresh this. No problem. It won't have a message on board. Have a value. But still it is a from storage will work. No, that is great. A simple program which will take my name on my age and give us some outward. So let this gets right. We're going to say document dot Right, And in here, I'm going to say front, I might say, Write your name. Come back in here, refresh this and as a conceit, write your name. I'm gonna say Ah, really about your age. Let's say 22. As you can see, it says Ali Internet. Now, if you want to print it in a decent way, you can say name done. Plus the prompt Similarly pinch. Okay, this will go out age. We look inside from mitral, your instructor the right to document. All right. And we're going to see plus and and and I'm gonna write. Plus, they are I'm gonna save it. Come back in here. Refresh this time, Ali on a stranger. And as you can see, it looks backed up. Now, as you can see, this is really, really long text. And if you want to write a bigger text and if you want to include other the optional argument to then you'll have a problem. So what you can do is you can take this out. Um, in here you can create a variable. My name Niekro's this prompt. So whatever you enter in here, for example, you entered early. So the result elite will go inside and you can print just really my name directly on. Similarly, I'm gonna take this. And if you come back in here and refresh this, you'll see your name on genotype down this time too early and ages again. 22. And as you can see, it works perfect. It's all the same. Now what we're gonna do is we actually want toe are put numbers. So we want to create a calculator. Let's create Cutler. Uh, let's get counselor get lyrics this way. It's addition culture, so it will add two numbers. So what can we go? It's simple. It's in here. Instead of this letter enter and in here. I'm gonna take one out. I'm gonna say in here Edition. Okay. Not in here. I'm gonna say number one come to and I'm gonna corrected. And inside a bracket on Save it on. Let's come back and refresh this. Let's put number one as one. Them to West one and African. See, it displays a limit. Why is that? Well, basically, it's simple. It's saying this is a string, right, A string. So you're saying there is one and you need toe contaminate? It means merges with one. So results will be 11 It doesn't understand. This is the number to tell. If this is a number, we have to use a simple statement or function called parse float on. We just parts float in here. Similarly, we have to add par slowed in here. Let's sit this. And now we for try this thing, Uh, 11 is going to say to Are you guys that was old for this trail? And also in the next room? 7. Introduction to Arithmetic Operators and Assignment Operators: your worst of guy's American. Welcome to Jonah Scripture number six and distribute. Gonna be learning about operators. So let's get started. Well, uppers are basically symbols or correct er's that represents some action. For example, the corrector, or symbol, plus the person's edition. Right. If I was a document, don't right one plus one. The plus sign it presents edition. Right? So similarly, we have other similar what you can say symbols and they are called mathematics and both in terms off multiplication Indigent division. We have symbols called mathematic openers. They aren't plus minus subtraction, Uh, multiplication or on division. Now, after the division, we have something called modelers. This president's sign is motiveless. And what model is does is it tells you whether there is a remainder or not. For example, if I divide five or 25 by five easier any remainder, there is no remainder. Okay, so there is no number, meaning it is fully divisible by five. So that s Stratus. I'm gonna change this. Imagine a pot kind I'm gonna change it to It's your five on for the secret office. Let me add a variable var x, and I'm gonna give it really lets it be are so that would be our on. I'm gonna add it in here. So let me had it in here. I'm doing it by pressing control and going All the places sound are clicking on my mom's button. I want to say, Plus, after that I want to see ex so it's easily solved and now I'm gonna run this. As you can see, it says to Well, one plus one is what to obviously one minus one is zero one times one is what one right? Uh, let's keep going. One divisible where one is one 25 borderless five zero. Why is that? Because there is no remainder. For example, if I divided by six, there will be a reminder. There will be a reminder off. What? Let's see. There is remainder off one because it is not not completely divisible. By six, there will be a remainder off one now. After this, they have other to arithmetic operators that are called in commending and recommending operators or whatever you wanna call it. But it's called increment and equipment. So how does it work? It's really simple. If I give some variable value, let's say I give a value off time on I said document did write that repairs this on. I say eight plus plus plus Plus Basically it will tell it to increase it or in commended by one. So if I come back and re fresh this as you can see this system, why is it 10? Well, because we are asking it to implement it after you have fisted it. We will ask it to implement it before you run documentary trip. Now, if I come and refresh this on what it's gonna say 11 so previously it also got implemented , but it has written first and then incriminated. So if you you are at plus plus before the variable, it will increment it first. Then run the right statement. If you right after this, it will increment it litter after it has been writing. Similarly, we have another document of rod um minus minus k. This thing that is called minus minus A on this taking basically dick criminal by one. So if I refresh this, it's as you can see, it will show us 10. Mrs. Chan, I didn't have the place. And as you can see this is 10 and it has been documented again. So the place place means incriminating and the minus minus mean dick lamented. If you add my plus plus or minus minus before the variable, it will implement or deacon meant first and then render Document that right if you write it after the variable, for example, if I write it after the variable. Alright, it minus minus. It's willing, Dick lamented. But what will happen is, for example, if I go now on refreshes, it will show me 11. It should show me 10 because it has documented, but it will declaim it later. How do we know? Let's go to inspect element. Let's come in here. For example. Excuse me, We got council on BC. Right, What is the value of a value of is town? But it has shown me 11. Why? Because it has written first when it where has retired It was 11 on Documented it, my one. So it became 10. No, similar to ath magical creatures. We have other Oprah. Just that guard assignment. Oh Pritchard. No, these assembly operator basically means men and I save our ex people's or bar basically white because 25 this equal sign. Three prisons a Simon so equal his assignment. What career? Okay, now, if I say, uh, vai plus equals five So basically that means why it was why, Plus five. Why? Because y plus five minutes at five to the previous my value. Similarly, we have similar operator y minus. And as you can see, everything is working. So let's check this. We have to unify. Why equals 25 right? So we added it for five. It became 30 on be subjected by 10. So 30 minus tan will be 20 and 20. Many what, 20 times? Yeah. 20 times five is well 100 obviously on divided by 100 divided by five. That would be 20 and is 20 divisible by five p. S citizens answer is zero nor Amanda. Okay. And that was all for this trail. And also in an extra bye bye 8. Introduction to Comparison Operators: you must have guys Osama and welcome to Java Scripture number seven. In this room, we're gonna be learning about the comparison operators. So let's get started. Let's first understand what are the comparison uppers? Comparison? Dopers are the symbols which are used to compare to values and return in the true or Fels based on the comparison. And these comparison offers are double equal exclamation mark equal means nautical. This is equal this nautical. This is strictly equal. This is strictly note equal. And this is greater than this is less than that. This is created and equal to and less than equal toe understanding these offers. Let's compare the numbers. Let me open up the council, right click in here, go to inspect element on go to council and in here let's compare a couple of numbers. Let's use the equal A for your first I'm gonna say is 25 equal to 25. The answer should be true because they are now. If I want to check whether 10 is not equal to 20 obviously dancer should again be true because 10 is not equal to 20. So answer is true. For example, if I want to say 10 is equal to 20. The answer will be false because they are not equal, right? No. Next. Actually. Create two variables. I'm gonna create two variables. War X, that is equal toe 30 Anwar. Why that is equal to 50. Let's compare these numbers. Let's suppose I want to check whether one is greater than the other. For example, this one in here, the grated inside. I'll look at these two later, but for now let's look at the credit in or less than I'm gonna ask. Is X greater than 50? So the answer should be What? No. Because acts is not greater than 50 is executed. Then why again? The answer should be false because X is not great. And then why no is y great in an X? Yes, by his good an X because Y is 50 and access 30. Now let us come toe These two uppers grated and physical toe in less than physical. If I want to compare two numbers is to greater than or is equal toe poop well, this means that check whether to is greater than two for true is equal to two now if one off these is true, the answer should be true. It's degraded into no is to equal to two. Yes, so answer should be true. Similarly, we can see that if we use the lesson sign on, let's suppose is one less than, uh to yes, one is listen to. So it's looking like this is one listen to or this one equal to two. If one of these is true, it's gonna return through. And as we can see now coming back to these two, we have seen that if I compare 25 25 I would obviously get what truth. But if I compare 25 uh, String 25 what will happen, obviously, to return? True Why? Because this is also 25. What happens in the background is that this one also gets converted toe a number. That's why it says true. But what triple equal does is it doesn't do the convergent. It actually checks, whether they are equal or not based on their data type, based on whether they are string or a number or whatever they are. So, for example, if I want to say Trey five triple equals 25 or this 25 it would return false because this is a string and this is our number. So return False. But if I compare a number with number, it will return True because they are equal. One is number of the other one is also number. Similarly, I can check whether they are not equal. For example, I can check whether 100 is not equal to 100. This 100? What should be the result? The results will be true because they're noticeable right now. Let us take a simple example before we finish up. Let us suppose variable called password On it is 1234 right? No, I'm gonna say document. You tried I'm going to say is possible people to let's suppose prompt in here I'm gonna say and put concert. Let me finish this up on if I come back in here and refresh this as you can see if our type 1234 on it says true means this password and these password match went to 35 for whatever your time. If you type incorrect is going to say false. So that was or for this tutorial. And also and then it's true by my 9. Introduction to DataTypes and Logical Operator: yourself, guys. That's ironic. Unwelcome toe jam, a script training, But it industry. We're gonna be learning about the data types. Andi. Logical operators. So let's get started to understand that the types not as great a variable var x on. Let's give it value five. No. What is this? Five now this five is basically data, right? Why was the data on it is off type number? Similarly, if I create another did that, I Let's it then, uh, name this person. But my name. Really? What is this? This is a data. Ali is a data on what I visit. It is a type string. Before text in programming, we use the keeper or the word string now similar to numbers and strings. We also have a dead data types. Let me write far. Uh, are you human? Are you human? Equals? True. Now the key were true is a data. It is a type What it just of type Boolean. Now this brilliant can either hold truth or either cold force like in machine language. Ah, machine language can either have zero or can either have one similar to that. A 1,000,000,000 can either have true or can either have force now. After this we have got array. So I'm gonna save are my friends No, this Hamid Moussa insult on their data. Right? And they are off type work. They are type array. And mostly we have the object data type. Let me create a very believe are D equals document Now what happened? This document, as we know from Documenta tried became deep. No, What I can do is I can use instead of document d and access other things from here. And now if I run this you see that it is working Correct on If I go to consul on if I write my friends, you will see that they hold Hamid Moussa Consultant So they are working correctly now talking about logical openers Logical operate has see operators only the and upper the or over And in North Opera How these over it is really easy But let us first take the not operate because this is the easiest run. No, I suppose I have a bar. Yeah, that holds really true. No, If I write the exclamation mark on a what it will do, it will inverse devalue means that now it will give you force but the value off a still remains true, so it changes the truth to falls and falls the truth. After that we have got the and over what and over it does is it takes two values or two conditions. For example, I said 25 is greater than 10 on 30 is less than 50 as we know that these two conditions are true. What the result will be is true. Why? Because thes two conditions are true. But if one of the conditions is false, let's suppose five it will give you force even if one of the condition is false. If this condition is false or either this condition is false, it will give you force on. If both of the conditions are force, it will still give you force. So as you can see force now, after this we have or over the or operator is really easy to understand what it does. It will give you true. Even if one of the conditions is true, they're supposed this will result in force, right, because one of the condition is force. Now, if I put on in here true because what The first condition is true. The second condition is false. The overall it will give you true. Now if both of the conditions are true, what it will do, it will still give you true. What if neither of the conditions are true? Well, if neither of the conditions are true, then it will give you fools because none of them is true. 01 of the condition is true. The 1st 1 let me put in here 00 created. The second condition is also true. I am not concentrating its supposed town in here. So now both of the conditions are false. Now what will happen is it will result in false Okay, guys, that was all for District. And also in the next true bye bye. 10. Introduction to If Then Else Statement: us of guys them. I make him Welcome to JavaScript. Stream number nine Industry. We're gonna be learning about the if statement. So, Laska, start this. Children tells the JavaScript, Compile A to execute the court on Lee. If the condition is true. So if the condition is true, then run this piece of court. If not, then skip this piece of court that has actually taken example. I'm gonna create a variable called possible for on I'm gonna say thrown and the prosper. Now I'm gonna see if the possible for equals 123 Done rent this place, Of course, Britches. Welcome, Mr Ali. Let's say this and let us run this and you're gonna see it says into the possible outset. 123 on It says, Welcome, Mr Early. But if I don't enter 123 all enter 000 on. Let's see, it doesn't give me anything because it skips this court, This court in here and there is nothing outside. So there is nothing. But if I write something in here, for example, is a document of door tried gate program as finished the running. So let's come back. Let me refresh this. Let's say 123 is gonna say Welcome Mr Early and after that is going to say the program has finished running. Now, if I enter incurred passport, let's 0000 is going to say the program has finished running, so it only skips whatever is inside it checks if this evaluates to true. So if this earlier it's true, then it will run this piece of court. If this doesn't evil way to truth, it will skip this piece of court and it will go to the next court. I hope this is understandable. Let's take another example. Let's say I have two variables were back amount that is equal to 1000 on. Let me just check this out on. Let me just Okay, so in here, I'm Mr of our visual amount equals parse Float in here. I'm gonna say front, so I'll ask him to enter the visual. Okay, amount accident. I'm gonna go on, say, if David Drool amount, it's created in the bank amount, Then alert until these air that David drool amount that seeds your balance. Let's suppose like us. Let's sit this. And after that, we'll gonna say document or tried. Thank you for visiting. Thank you for visiting. Let's run this. Let's refresh this. I'll say, for example, first I would write 1000. It says, thank you for visiting. What? Because the amount doesn't exceed the vitriol amount. But if I exceed individual amount even by a single number, let's try this. If I sit 1001 it's going to say the drill amount exceeds your balance and is going to say thank you for visiting, but we want something extra right? So if this condition evaluates to true, then do this. But if this condition develop words to false what to do, well, we can use the else part to say. If this condition is true, then rent this piece of court. If the condition is not true, then run this piece. Of course. So you use else for telling it If the condition is false, then run this piece of court Now. In this piece, of course, we can say bank amount equals bank amount minus individual amount on. We can see alert in here, you're you meaning balance. Then I'm gonna say, Plus, in here, I'm going to say bank amount on I'm gonna sit plus again in here. I'm gonna say dollar. So let's save this and come in here and refresh this. I'm gonna write like 1001. It's It's the visual amount exceeds your balance. Now, if I write 100 because it doesn't exit. So it says your remaining balance is $900. Pick, click. OK. And it says thank you for resisting. Okay, guys, that was over for this trill. And also in the next trail. Bye bye. 11. Introduction to Else If Statement: us of Guy's American. Welcome to JavaScript. Sure. Number 10 in destroyed. We're gonna be learning about the else. If statements Alaska story that support. I create a very bold student blocks. I get the value from the user. If the student marks are greater than or equal to, let's say, 90. He should be alerted with gritty. Okay for it, plus on a And if he gets 80 or more than it, he should get a So we can do that by saying else if else, if not else else, if now we have another condition else. If we can say student marks its greater than physical toe 80 then he should get what alert . We should get it else if I have under the condition, so you use else if you have multiple conditions. Now, if all these conditions daughter work, let's suppose because this is our dummy program. Let's say if hey doesn't get get until 60 I want to give him alert, saying, drink your parents So if none of these conditions work, then the else condition will be executed. Now let's try running this. I'm gonna come back in here and refresh this. Let's say 85. He's gonna get a now. Let's come back on. Let's put 65 is he's gonna get See on if you get around 50 bring your parents. Okay, guys, that was all for this trail, and I'll see you in an extra bye bye. 12. Introduction To Functions: yourself, guys. Sam Ali Khan. Welcome to charm a script. Strong number in lemon In the structure We're gonna be learning about the functions. So let's get started now. What is a function? A function is a look off court. It can be executed. My never call it. Okay, so let's create a simple function by saying function on the name of the function My function on the practices on the curly versus this is how a function looks like now inside here I can write whatever I want. For example, I want to write Ellard so I will write Allert. Anti function is working. No, this is a separate court. If you don't call it, it will not for let's suppose I write document or right. This is working. Let me just say this and come here and refresh this. As you can see, it says this is working, but it doesn't give me honored because this is a separate piece of court. Okay, now, to call this function or to execute this function, you have to write its name. My function on the Prentice's on. Then just we're finished now. If I come and refresh this advocacy function is working me this part of court. This court has been executed. If I click on OK, the remaining court gets executed. Let's create a simple program. We're gonna say function addition. Known what this program will do. It will add two numbers not to add the numbers. We need some input. Right? So the input will be number one on number two. So this is the input, I can say. Alert number one less number. No, I need to call it right. I'm going to say addition. Now, if you see in here, you need now to inputs, right? So you have to give it to imports. I'm gonna say edition on Give it to inputs like 25 on 25. Now, if I come in renders as you can see, it says 50. Why? Because 25 plus 25. 50. And we are alerting it so we can have as many inputs as we want. We can have like X y Z, which will be plus X plus Write plays E on a In here. We can have as many numbers as we want. Now if I come here and refresh this, let me click on OK first and refresh this. As you can see, it's just 1 25 now. After this ah function can have an optional return statement, for example. I can say function at the Shannon on I can say in here Return. What do I mean by that? Let us suppose I'm going to display the addition in document or trying. How can I do that? Basically, I can say documented and daughter right on in here. I can say additional on in the edition. I can, for example, for two really was number one for example 25 on 25 In here. I'll have to numbs. Let's say X and y no matter what they are, they don't make a difference. They are only limited inside affection. So I can say X less. Why now? If I write in here return, you will get the answer in here. So if I come here and refresh this, you will see that you get the answer in document, right? So what to return? This is after it adds it brings the answer in here. So this is the return. So what this piece of court means is this right? So when explains why is returned. It goes inside this directly. I hope this is understandable. No. Before ending this, let me show you something really interesting. I'm gonna say function. I'm gonna create a function called addition. I'm gonna go at the top and create a button on inside a button. I'm gonna say addition, Aspirin as own click. I'm gonna say Edition. Remember what I told you that it can be called when you write its name. Right now. I wrote its name inside a button. Now, if I click on the button, this function will be triggered. Let's come here. Let me refresh this on me. Click. On addition, I have to enter a number. I'm going to say training. I have to enter another number to say 20. And as you can see, it gives me 40. Now what I want to you to do is I want you to create a calculator which will do the addition, the multiplication, the region and the subtraction. So, guys, that was or for this trail and also in the next real and make sure to post the answer in the Q and a section 13. Introduction to Switch Statement: You must have guys that are leaking. Welcome to John Scripture number 12 in the street, where we're gonna be learning about this street statement. So let's get started. This such statement or switch function is a function which is used to perform different actions based on different conditions. For example, let's write the search strip mine. I'm gonna switch on. My condition is grid. Let's go in here. If in case the grid is it or here, then document Don't, right. You are awesome. In case the career is be document. Do it right. You're doing good. In case your Grace. See, then document write. Please work harder. And lastly, default means if it's none of the conditions above, then I'm gonna say document not right. Leave your wife front slash girlfriend. So we have these conditions. The problem is, for example, I get it. Let me actually get their grid. Some disagree. Equals prompt and grit. Let's set this unless run this now, if I enter a what will happen, it's gonna bring all these courts. What we need is we want to tell it back. If I write a it goes to write, it goes to a then it prints this. After that, it keeps on grain. That is not good. It should get out of the six statement after it has completed the case. So what we need to do is after every case we need to say break brick means get out off the street statement. So if I said break again, prick, this is enough because for the last one, we don't need break. Let's run this. If I say now, it's great. A As you can see, it says you are also NASA pose. I'll say to students who go to K on B, I'll say the party is owned me, right? God, under my eyes, no party for you guys. Okay, so how can I do that? For example, for a the parties on me. Okay. The party is on me. No, for B, I can say the sin. And for cnd Mm. No party for you guys. Okay, default. We'll say there waas a problem and so on. So for now this works fine. But as against the I'm repeating myself right in here I'm repeating And repetition is a curse, as I always say. So what you need to do is just put this thing in here. So what will this do is let me take this out. It will say if its case A or case be then is going to say the parties on me. If it see and then it's going to say no party for you guys, for example. I want it to say no party for you guys in If district gets ready Colin, it is. It's not a semi colon. So if I try this now and refresh if I write it a like this, it's going to say the parties on me. If you go to be, it's going to say the parties on me. If I go to see no party for you guys, if I go to D, no party for you guys. If I goto af it's going to say there was a problem because after is not including in here, Okay, as that was old for this trail and also in the next room by 14. Understanding Function Libraries: us some guys that American Welcome to Java script to tour the number 13 in this church. We're gonna be learning about the JavaScript libraries. So let's get started. So a library is a collection off court that is available to you. So someone has credited and it says that you can use it. It is available online. You can search it. No problem. And you can find it. For example, if I go to Google on if our search for, for example and yang library, you'll see that I have it a Wilbur at guitar at all other places. But how do you know that? Do you have these libraries available? You can search online by saying pajama script libraries from Java script libraries on A you'll be ableto get a list off libraries that are available. So data bus off JavaScript libraries, and you can see that you have a lot off libraries in here. Okay, that is none over concern for now s first understand? How can we use it? Basically, So let me, First of all, go back to my editor and in here, I'm gonna include the library's. Now, if you try to use the court. From there it's really easy. For example, from the drawing library, the drawing library. If I tried to use some court, let s suppose ah, stars or draw a rectangle. Let me use this function. Draw a rectangle which needs heart with color and inland ended is basically space between the stars. So if I come back in here and say a draw as you can see, I have this on I want to draw a rectangle. Okay, you have a couple of requirement. As I said, you need the height, soul height, the word, the color. Let's a read on the indent. Let's that one. We don't want too much in that space that could be in pixels. Now let us. We're in this. And as you can see, we get this rectangle similarly. Let me create a draw. Let's affirm it on. What do I need for dot I only height and it color and I need ended. So there are three imports or three arguments on it. Hide behind it. Color. This time it's purple, and I need one end into this one. Same, and I'm gonna save and come back in here on. Let's refresh this and you will see that I have firm it in here. So this is really easy to use. All you need to do is go inside the library and follow the instructions if they are given, or they will be given inside the website. Now, actually, let's go back and let's try using Anyang. I'm not gonna show you how you can go and bring out stuff. I'm gonna show you how powerful a library can be. So let's go to an yang, and I'm gonna just copy this on. I'm gonna come back and pissed it in here. Now I have it in here, right? So it says if you say hello, it's gonna say hello over. But instead of hell over. I wanted to say hello, Ali. So what will happen is if I come back and refresh this. As you can see, it is asking me to speak that mistreat. Hello. As you can see, it says, Hello, honey. But if I want to change whatever it is the common, for example, I want to say it. Love. It can say, I love you. Love you too. I mean, come on, I'm joking around, but that's the idea. Love, love you too early. As you can see, this is how it works. This is really, really, really strong thing. But if you don't believe I still go back inside the Google and type Anyang on, go to the talent er dot com in here and they will actually show you some stuff. Really awesome stuff. For example, in here, I'm going to say Show me Peter Parker. So, as you can see, it is searching for Peter Parker on it. Finds some picture. Okay, guys, that was or for this trail and also in an extra ill by. 15. Introduction to Variables Scope: You're welcome, guys. I'm already can Welcome to Jonah Scripture number 15. In this tutorial, we're going to be learning about the variables scope. So let's get started. Simply speaking, variable scope basically means that the variables that are declared inside the functions, you can no access them outside of different. So, for example, in this situation, we have what we have Variable called y inside the function and and that the y, which is outside of the country and as we know that function cannot be used unless call. So we are gonna start from here. We have two variables called X and Y and X has value for And why has value five. Now we go inside the function and we give it really want Why, Okay. And this Why is in here x so X Times acts basically means no, this X, it means the value of the right. So now why that is outside in here became X. So why the camp packs simple, right? Okay. We understand that by became X. So what will be the value of X? The value of the excellent What is the value of fire which is fight no after coming in your we see that there is another variable that is being created and it just called. Why 10. Now, here we are calling an otherwise now which my arm be using that we are using the why which must created inside of different. So the priority or the president's or the more power or which one to be used first will be this because it is inside, it is local. So if you don't have are in here, then this one will be used and it's really will be changed. But in here we have created a new verbal. So let's save this and let's look at the answer And the answer is 2500 wife, because this is five and five times five is training five. And why? Which is this one? This one is being used so white times. What is what 100? Well, let me just change this variable from why to hear No, we don't have any variable by in here. Right? So the wife which will be used is the why outside. So if I refresh this, you will see 25 training five because the white that is being used in here is the global one on. Let me show you something else. Let me right, X. We get really for Because it has really? For now. We right? Why? Okay, we get fired because it has value five. Now the right hero, we get nothing because it says we I don't know what is this? So the variables that are creating inside the functions are no accessible. You cannot access this variables. They are restricted inside off the function. And once you finish the function, it actually destroys the very well. So they are known existent. They actually don't exist in the system. What, you guys, that was old for this trail. And I'll see you in the next true bye bye. 16. Introduction to Arrays: you're What's up, guys? American. Welcome to Javascript to number 16 in this story. A We're gonna be learning about the rate. So let's get started. First of all, what is in the area are here is a very well that can contain multiple values. For example, if I want a list of friends, I can't write friend one or for friend, one friend to country. That is incorrect. So what I can do is I can write. You are friends on. After that, I can have all the names off my friends. So, for example, I write my name. I have no friends. So Hammett's on, uh, Soltan, Um I have many, so I can just Oh, I can change this. Let's write separate in here. Okay? Now I have the sprint and they are stored inside of a report, Onda. And let's right click and go to inspect Element. Let's go the council and let us get rid of this. Now, if I write the name, uh, friends, you will see that I have inference. I have all of the names on after that. I have the location of it. I have Sabrina, application zero and Hamid at location one and sultan application to And the way location works is basically if I want toe print. Ah, Hamid, I can say document. Do it right. And in here against their friends. Different number one because we started off it zero. And basically, it means that this is at zero, and this is at one. And this is a two as we saw in here. Okay, Now, if I saved this and come back in here and refresh this, you get home it. And if you want to print Sabirin that you can just go for zero and come in here and print it, no problem. And if you want to know how many will use to have in your array, you can always say friends dot lend g g Yet on it tells you that there are three values. Okay, guys, that muscle for this trail. And I'll see you in the next trail. Bye bye. 17. Introduction to Loops (While Loop): you're some guys. I'm really come. Welcome to Jonah. Scriptural number 17 Industry. We're gonna be learning about the why. Look, So let s get started before understanding my loop, let us first understand what exactly a loop is. A loop is basically repeating off court Off course. This seems strange, right? So let me give you an example. Let s suppose I want to print conducting that dot right? I want to crank 100 numbers. I'm going to say, uh, one sample space. Then I'm gonna go to document or try. Then I'm gonna put two on. Then I'm gonna just give it space. Similarly, I can do this by also coping it so I can cope with this on. Keep on repeating this for how many times? 400 times. Well, I can get it done right. So if I come and refresh this, it's 1235 I'm just 95 steps away. Well, if you look clearly, we are repeating the court. Now, this reputation is what loved us. But in alot more less court. So let's look at how Luke will do it. Let's check this out. The love you are gonna be learning is called by Lou. So we're going to say while then there is a condition in here, then this is the court which will keep on repeating. It will keep on repeating until this part of the court is true. When this part of the court becomes falls than the court stops than the cord stops. If it's true, court continues. Okay, we get it. So what we're gonna do is we're gonna say far to, uh, equals print or parse float. And I'm gonna say prom. And in the problem, I'm going to say Enter till what? So we're just getting the numbers Still, what do we need? These number to be printed. But maybe you want it for 1000 rather than 100 so you can do it using this. It's really easy. After that. We need an initial value. We're gonna say Who are I? Is a Colt zero and in here I mean, it's a document. Don't ride. All right, plus space. Simple. Now the condition in the condition part, I'm going to say, Tell eyes not equal to 50. Then keep on repeating this court. And every time you repeat this court increase, I buy one. Now, this looks really confusing, but hold on. Let us just play this court and we'll see the result. And you will understand how awesome, distinct ISS. Let me write till 50. It's gonna print until 49. So what we can do is we can say instead of this, we consume till work in here. I can say plus one. So this time, if I print until 50 it's gonna give me 2 50 So if I say until 50 it's gonna print to 50. Okay, I can do that. I can just write 50 lines and it's gonna be done. OK, you can do it, but let's write build one or 10,000. Can you do that? And you forgot sick. Do this. No, me. You can do that. If you can do that, then you're stupid. I'm not calling you stupid. If you can do it or if you do this, then you are sorry for that again. So this is this is really or something. This look. So what is happening in here? Basically, it's looking at I value it's saying that now. I is what I zero So is gonna check. Is I or zero equal to 50. No, they are not equal. So this is true. They're not equal eyes, not equal to 50. So this is true. This is true. So it's gonna go inside and in agreement, I buy one. So now I is 11 is not equal to 50. Right? So this is true. So it's gonna keep on repeating empty. It reaches 50 now Isaac will to 50. It's 50 nautical to 50. Come on. Can I say that 50 is not equal to 50? No, they're equal. So my statement is false. Now my statement became fold. So I have to get out because according toe the law or its low or loops law, they have to get out of the loop once the condition becomes false. No, outside the court, you can keep on doing whatever you want. It's a document. Don't write cord or this it blue as and on. I can put a br in here. No problem. Now if I come in here and refresh this and put 50 as against it shows me loop hats ended on . This is really, really powerful thing. So make sure to learn it. And also in an extra bye bye 18. Introduction to For Loop: You're welcome, guys. On my Lincoln. Welcome to JavaScript. Stream number 18 Industry. We're gonna be learning about the for loop. So Alaska started before we get started. First of all, let's make this clear that the Via Loop is no different from the four look. And the four look is no different from the vile. Yes, one can be easier than the other in particular situation, but they can do the same job. No problem. Okay, some might argue with me, but just asked him discussion or ask her this question that can I do something I did with four. Look, and I do it with Milo. People say yes on something that you have done with my look. Can you do it fit for he will say yes or she will say it's no problem at all if he or she they're saying that this confident, then they are wrong. I'm sorry. Okay. After we have fought about this, let me sustain my argument. I said something I have to sustain that I have toe makes give some proof. This has pissed this, uh, according here, and that is violent. Court on. Let's take the first line and put it up because it's just taking value from the user. So I'm gonna be repeating the same court. No, which is four bigon means the initial value. Let me give it this initial Really instead of big. And let's put this okay. After that, it says while I is no equal to till what less one. I'm gonna take this and put it in the condition position. So I'm gonna put it in here after that step statements each time, this will be incremental. So each time this will implement, it should be appointed to this. Andi, let me just take this, okay? Let me take this to put it in here in the blue body. So let's put it in here. And now I'll just get rid of the why. Look, because it's just no longer here. Okay, Okay. Okay. Let's have this. Let's coming here. Okay, Andi, let's see till work till 50. That's until 50. Now it prints still 50. As you can see, it's same. No big difference. No. Let me take another example. I'm gonna create a new or I'm gonna save war on. I'm gonna say friends, as I did in the A rate tutorial. I'm gonna write in here, my friends, and it's a comet. So on, uh, on after we have done that, let a script for for I Is it quitters here? I can write in her far. No problem. Here you are. I is less than is equal to no less than friends. We thought we went then I plus plus in here and when it's a document tried, I'm gonna put a friend's name and your Communist friends zero Not your I So that every time , if it's eyes equal to zero, so when it comes inside, it's going to look at this, and I zero is gonna print Hammett. When I increases, it's gonna come back in here and eyes one. So it's gonna print Sultan. Then again, it's gonna come when ice to it's gonna come and check I store. Then it's gonna print What small print Moussa. So let's actually put a big are in here so that the court could be separated, for the words could be separated where the names could be separated. What's coming here? Let's refresh this. As you can see, I am able to get well use from the array really easily just using this. I don't have toe every time for document or trying Friends. Zero Let mender tried friends Want to try it? Friends too. I can just put this simple court in here and this simple these two lines on. I can just get more than billions of values if there are. If they're on, I know there aren't, But I'm actually somewhat excited. I don't care. OK, guys, that Russell on Al to in an extreme bye bye. 19. How to Print Page: your subjects a modicum industry. We're gonna be learning about printing webpages. So let's get started. Now. I suppose we have some heading in here, so I'm gonna put a heading. I want to say catch one on here. I'm gonna say beckon on control on this happens because I haven't told on up or an extension in here that is called Become ipso. So after you write bacon on press control, you will get some strip production here, garbage text or whatever you wanna call it on. After that, I'm gonna save it on dring the pitch or display the fish. And as you can see, we have a good amount off Texan here. No problem. No, What I want to do is I want to create a button. So I'm gonna just close this from here and close this from here on in here, and I'm gonna create but Britain. Um, in this year, I'm going to print, but inside the print, I'm going to say on click and Sprint, Tex or drink Pidge. Uh, this is gonna be my function in here. I'm gonna create a function called Skitch on inside here. I'm gonna set window dot friends. Apprentices. I'm gonna sit this. Come back in here. Refresh this on. Come down in here. And as you can see, we have a better. So if I take this up, this is the better. I'm gonna click on this button. An African See, We get the window for printing so you can print it. You can also change your printer. You can set the number of pages and so on. So far. Okay, guys, that was old for district. And I'll see you in the next trip. Bye bye. 20. Create Live Digital Clock: us of Guy's American. Welcome to dysentery industry. We're gonna be learning. How can we create life? Look, Solar, ask a story. First of all, I'm gonna create a actual in on. I'm gonna give it I d lifetime on. Just leave it as it is on and I'm gonna have the script. I inside. Descriptive. The first thing I need to do is I need to take this object or fetch this object or French each one a reference stretch when they all mean the same thing. I'm just a document. Look, get element My i d On the idea is, as we can see, its lifetime, uh dot in the estimate is equal to I knew it on. I'm gonna come back in here. Refresh this on as agency. It gives me the dead, the time, the GMT, and so on silver. But we only need the time. So what? I'm gonna do it before it is I'm going to see it Go are my kind. It is a culture new bit. So basically I am creating and then a data objects so I will not need this. So if I in here type my time on come here on save this and in here I'm gonna refresh. This will give the same thing. Except the time has changed a bit. So what I'm gonna do is I am gonna gonna fetch on Lee at the time. So how can I do that? That's kind of hard to do. So we're gonna say are hatches a Toronto my time dot Get ours. So first support, they're gonna get hours from the dead on a then minutes a close my time. Don't get minutes. Get minutes. This is the one on last year, Ignace In my time War Second is a photo. My time. Don't get seconds on in here. I'm gonna write first the hours I'm gonna say Etch, then I'm gonna come. Captain ate it. Coolum, Then plus done. Uh, minute. Then plus, Then again come caffeinated with this colon. And then again, the plus on. Then the second I forgot that I need these Prentice's at the end off all these methods. By the way, these are methods. As you can see. Three for 27. It's three o'clock in the morning for minutes and 27 seconds. So what can we do? Toe? Make it live is really simple. First of all, they're gonna create a function function. I'm gonna live. Look inside it. I'm gonna drop everything from here on and and then I'm gonna say set internal in the interim, I'm gonna type life. Look on after it should be updated. If, after every one second on in the body, I'm gonna say, Oh, Lord life. So I'm gonna come back in here and refresh this. And as you can see, it is life. So what happened in here? And basically, this lets me repeat same court. Ah, in financially. So I I'm telling it, toe, repeat the life clock dysfunction after every second. So after every second it comes in here, it goes inside this on it repeats the court and comes here and again repeats the court. So it's just like a loop on after that. This own lord basically means when I come to this bit when I refreshed this page and now I have loaded the page, what will happen is it will call the my clock function the or the Lifelock function. Okay, guys, that puzzle for district reel and I'll see you in an extreme by my 21. How to Make Random Colors Effect: you must have guys. American. Welcome to district your industry. We're gonna be learning how to make a changing color effect or basically, how to make something like this. So let's get started. First of all, we need match one on. Just tried this. Now, in here. What I'm gonna do is I'm gonna create two functions. Number one function would be, man. Thanks. Mean on to function, change for loose. Um, that's all in the main function. We'll have something like this. We're gonna say procession into Rome. On inside this, we're gonna say changed colors, coma change color after for isn't every maybe 400 milliseconds or treatment. Really seconds. Yeah, 1000 milliseconds. Equal toe. One second in real life. Okay, so there isn't no in here. We didn't write something to fetch this veteran, So we're gonna say document don't get element by Heidi on ideas. But is that my heading my cutting, uh, to make text? Small reason, actually put it in. Mar de is a quote treatment of getting a good gentleman body. So if you're going to say day on me, just closed this and this de dot Oh, not color is equal to RGB not to pit rzb Renda Margie, What we need to do is really to say you are are is equal to matt dot Flora. It's up to you and your peace after that. We're gonna right, matt dot Bring them What? This little it will generate rend, um, numbers between zero on one because you ran one. So what we need to do is multiply it by maybe 2 55 to get a random number. Okay, after that, I'm gonna cook with this, um listed group. It is vested. It's been every day, t, and it's just gonna be a ranking from here. I'm gonna say rgb less are plus clueless, uh, less do you coma be Roma not come. Actually, this is done. So we have here and then enter this Basically what we need is we needed to be like this r e g our McGee Komer be so These are the values that mean it, but in text moment. So these will be in text moment. And this will also be converted later. Tax, Form it on a beard until this. So that has come back and read fresh This residency. There is a problem in court. Syntex here is a problem in here. I need to see. I need a plus on here. I know that Maybe you freshness. Okay. This is an ex working group. Now we need to trigger this court. The way to trigger the score is by going on body and saying on Lord on a runny the might mean friendship. No, come in here and refresh it again. And as agency, you get random killers or you can create something like this. Let me just take this from here so you can create something like this. It's up to you, Uh, the on the Methodist sale. Basically, instead of text I have used Kedev on that has a particular height and breadth. That's why it's gonna change the killer off a dip. Hey, guys, that was old for this trail, and I'll see you in the next year. Bye bye.