Javascript Programing For Beginners | Somenath Sen | Skillshare
Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
14 Lessons (1h 15m)
    • 1. Enroll Now !

      0:27
    • 2. Why You Have To Used Javascript ?

      1:58
    • 3. How to Write Comments In Javascript

      3:44
    • 4. Understand Javascript Statements

      4:01
    • 5. How Javascript Variables Works

      5:57
    • 6. How to Write & Used Functions In Javascript

      4:23
    • 7. The Return Statement In Javascript

      4:01
    • 8. How To Used Operators

      5:35
    • 9. How to Used "If" & "Else" In Javascript

      7:50
    • 10. How to Used "Switch" In Javascript

      11:11
    • 11. "For Loop" In Javascripts

      7:23
    • 12. "While Loop" In Javascripts

      4:52
    • 13. "Do While Loop" In Javascripts

      6:35
    • 14. "Arrays" In Javascript

      7:30

About This Class

In this class you'll learn about javascript. This class is design for beginners coder, so if you are new to javascript then this is the perfect class for you. So enroll the class now !

Transcripts

1. Enroll Now !: 2. Why You Have To Used Javascript ?: all right into this video, we will learn What is Joe Waas Gripped? JavaScript is a programming language that used to make weapons interactive. It's run on your visitor computer and does not require constant download from your website . It is lightweight and most commonly used as a part off with pages who's implemented in allow clients that script to interact with the user on dmat dynamic webpages. JavaScript was first known as Life Script, but Netscape change its name to JavaScript, possibly because off the excitement being generated by Java now you guys asks me, Are JavaScript and Java are the same thing? The answer is no. They're not Onley their name a similar job wise, developed by Sun Microsystems, and it is a powerful and much more complex programming language in the same category as like C and C plus plus. But JavaScript was created by Virdon. Each at Netscape and Double script is a scripting language, and it's the lightweight programming language that is interrupted by the browser engine. When the whip it is loaded. Almost all missile brother like Internet explorer chrome Firefox, the 40 have javascript in it. In the one next videos, we'll explore JavaScript in more details on learn. It's in text and semi metrics in step by step 3. How to Write Comments In Javascript: All right, So in this video, we're gonna learn how to write Java script comment. So first of all, I'm gonna go to my project folder Angop it is in next pile on Festered right after it. Andi would have to do is rename this index file toe in next hyphen Common's on right click on this index hyphen, Common start dates, table file and open it in. No pad plus plus, Andi, what I have to do is most of all, I'm just removed these document that right on in hair, we just type our comment. So, first of all, on Minister, you how to write a single line comments. Then I will show you how to write the multi line comments in Jalisco. So let's try me single and common. So if you need to write a single and comment, you need sh less on DSA less That's it. Unit doubles less. Then you need to write your comment. Let's say this a is each of us ripped government then said the file on Goto over product polar, and they will look on this filed open this up in the browser. Let's see how it looked like as you can see here as we expected. We see nothing here because this is the comment and brother will ignore those line because they can find this is the comment. So let's say now you have tow a multimillion. Common. So how you have to do that? Most of all I just given Ender on Go on next line. And if you die if something here, as you can see her, this takes are not green. That means the stakes are not the comment. So let's say we have some couple of lines here on. We need this couple of lines indoor JavaScript comments. So what have to do is we just type slash s. Then we just type star on when we have to end our comment so in gets this line. So what I have to do is hair. We just start with this process from backward, like first we need star. Then we need Slesin Now, As you can see here, these five lines are now in the comments. So if you want to write a multilane comment first you need to open its less than you need toe type star. Then you have to write your comments how maney line you want on, then whenever your line will end, whenever your comment will and you just write star again. Then he was less the end of the comment. So in this way, you can type comments in job asleep. Either it will a single and comment, or it will a multi line comments. 4. Understand Javascript Statements: Now we know how to write JavaScript comments on in this video we will learn what is jealous . Keep statements. So what I have to do is and just go to my project. Polar on copy. And best this in next file. Hair on rename this three next hyphen statements not external. Andi ratted on this pile on. Open it in. No bad plus plus. And first of all, I'm just removed these JavaScript comments there. Onda, we have some nice and clean space to write our statement. So what is the ah, skip statement? Actually, statement is very, very important in any programming language. So first of all, is a stipe here a simple document dot right program and give us the mink alone after this document, Right? Andi, when will give us Let me go alone after these documents, right. That means there's just a program Are ending hair on this call a statement. Let's just go to our project. Cooler and I will be on this file and open this up in the browser and has even see here. We have a line here. This called. This is a statement on the computer program are in here just because we add a systemic alone after this document, right? Function on if we want to add another takes or another. Lange's copy this document dot right program and pasted. Right? Afraid Andi just changed these textile this a statement to and saved a pile on goto our browser and difference the pitch. Now we have shooting. This is statement who lives a straight another thing. And so now it local nice and pretty. So let's just go to our brother and refers the pitch now, as you can see here we have the two lines here. This is statement. Then we have on this a statement to So what? This two lines Taleb Rosa the first line. Tell the brother print this text in the browser, Then bring this take in the browser. So when you write any juggle, stripped, cooled or any javascript function on end with a semi colon, the program will in there and that mark as a statement. So, in hair, we have who statement? 1st 1 is still a brother. Print this Tex on 2nd 1 is still a browser. After the stakes, bring this decks on, then exit the program. So this how the statement will work in any computer programming language as well as the javascript 5. How Javascript Variables Works: All right, so in this video, we're gonna be learn JavaScript really evil, which is very, very important part in JavaScript as well as any programming language. So don't skip this video, guys, because this is very, very important part. So as like the other programming language, JavaScript also has very well. Very well. I like the container. Which whole data for you on you can use those data by targeting the really will name into your program does the pretty simple concept. Let's say you want to use a data in thousands of lines, of course. And on the next day, you want to change those deter to something is so you just want to change those data onto those thousands of lines up court. What? When you come to variable, you can hold those data into a variable and use those variable name into those thousands of line. So when the next day is coming on, you just want to change the data. Just change the data into your very a bill on those thousands of line who hold those data using that very real will update automatically. That's the power off variable. So let's just type ajumma skipped Grievous before one type of JavaScript variable. Let's just go to our project. Fuller on copy this file and pasted right after it and renamed this school in next hyphen. Really? This on, right? Click on this while and open it in no back plus plus. No. Remove this document. That right here because we don't need these document daughter right here. So what have to do is just great. Our was variable. So in the javascript, if you need to create a variable, you need to type V A r. We are refer to video. If you like. Veer, the browser will automatically identify. This is a javascript irritable all it. So now we have to name our variable exploit. Is it anything as everyone but keep it in your mind? Every double skip very will start with a letter and, uh, underscore. But a javascript Reville will not start with the special letters or the percentage sign or the dollars and or anything like that, or the numbers or anything like that. Double scoop variable. Always we start with a NASCAR or with the simple later. So in this case, we just type X. So it is our very well. Now we just give us face and then give equal sign. And now we have to put our deter. Let's say 59 59 is our data on the eggs. Very well are holding this data Now we have a cynical A semi colon is closed. This statement, as I mentioned before statement in JavaScript are always closed by your cynical on. So we just close this statement on in the next nine. We just started document dot Right Andi, into this document. Not right. We don't need any the world condition here because we don't need toe print. Any text in document dot Right? We just need to print are really well, so we just type are really evil name directly into this document. That right conscience. So let's just type X and that's it. Save the file on goto our product cooler and double click on this. Quiet. Open this up in the browser to let's see how it looked like. Now, as you can see her, it just cleaned out our data push. He's into our eggs. Variable. So this is the power off the table. If I go to my text editor and change this data here. Let's it I just 60 and save the file on. Nothing to change in this document dot Right, because this already hold our very will. We just think that data into our valuable and good over brother and because the page and now the numbers are 60. So this is the power off variable. You can create a variable and old data into it, and you can use those Greeleyville name into thousands of problems of line on when you need to change the data, just change it into your variable on it will abyss those thousands of pounds of line off court without touching anything in line off course. So this is the power of able, and in this way you can create very reels in JavaScript. 6. How to Write & Used Functions In Javascript: So in this video, we're gonna be learn JavaScript function. So let's just go to our project four year on. Create a walkable copy for this estimate. Document on rhythm. It too. In next. Hi, Susan. Function on record on this file and open it in the note pad plus mus on in here. We just moved is very well from here. Andi, In hair, we just have a clear space to write our function. So what is the function? Ah, function is a group off reasonable court which can be called anywhere in your JavaScript program. This eliminated the need of writing the same court again and again and also save your lots of time. It help programmer in writing, modeler cord and also function allow you to program our divine a big program into a small number of programs. So let's see how we can create function in javascript. So, first of all, you need to type a keyword call function and then give us fis. And then you need to write your function, name whatever name you want, but before the function name you, all of it. So start with dysfunction. Keyword. When you write this funds and preorder JavaScript will identify. This is a function. This is a stripe, something like cool because it's a cool function anyway and posted this function Name you have to do is your friend is his record. Then we have toe open and closing our curly bracket on into this curly bracket. You need to type all of your court and when you call the school function, that court within this curly bracket will run. So lets us try a simple JavaScript alert into this function and tried in the throes of. So let's just state alert aan den open and closing our friend His record on this one disease we're open and closing our double condition into this condition is this type. Hi. I am open something fun on semi colon after this allergy and after this function, we need to call the function. So how we have to call the function. Let's just drive the function name cool and then we need to write down. The friend is record, and then we have to give a semicolon on sleep. The fight. Let's just go to our projects cooler and that would look on this wild. Open this up in the browser. Let's see how it looks like. Now, as you can see here, when you load the page in the browser, a double script L'Art will crop up and the Ellard will see the same text that we can add in this allard box. Hi, I'm a problem. So in this way you can create function and prove your JavaScript, would it? And all the function whenever you want it can save your lots of time. And also it can help you to manage your complex scored in a small parts. 7. The Return Statement In Javascript: holler to in this Really? We're gonna be learn about the return statement in JavaScript. So, first of all, I'm gonna go to my project cooler. Andi, create a walkable copy for the additional document this copy and pasted over here and just women aimed this to in next hyphen return statement and right click on this file and open it in no bad, crustless and now possible, unjust Removed this variable and function from here because we don't need it. And now let's talk about my written statement What you threw down straight meaning jealous region straight man is a function, actually. Is optional function in javascript. It is very useful where you want to return. A value former function on this statements would be the last statement in a function. So let's see how it looked like and how to create this return statement. First of one. This just creative function. Give it a name like whole gram, then open and closing friend asses and then open and closing curly brackets and into the skillet bracket. We will return a well. So listen, Stipe written then who need to type of value is this type of string. So open, enclosing double condition and into this condition. Let's just type the text show Waas Fruit doesn't nice and simple sticks on. Then we need to type the semicolon. And now it's just called the Function Program, then open and closing Francis's semi colons. Then said the file on Goto our project cooler on double Click on this filed. Open this up in the browser and let's see how it looks like. Now, as you can see here, JavaScript will print out nothing because we don't want to declare here. We want to print out dysfunction. We just call the function here. We don't want to tell JavaScript that brain dysfunction in the browser. So let's just bring dysfunction in the browser. So it just displayed this Texan, your brother. So what I have to do is we just got this conscience from here and is this type document dot right then open, including friendless, is on into this fantasies. Let's just call our function program and then semi colon and now sit the file and go to our brother and reload the pitch. Now, as you can see here, it just returned the value. We just bring the value So in this way you can use this return statement to return any value former function. It is very useful when you want to return a value home, a function. 8. How To Used Operators: all right. Now we know how to use the return statement. Now let's see Woody's operators. So, first of all, I'm gonna go to my project Fuller on make a local copy for the estimable document this copy and pasted over hair and rename it to index hyphen operators on red. Click on this file and open it in notepad Plus plus. No, First of all, let's just delete dysfunction from here and let's get a very evil first X. Then it will do. Let's just say hi love, fun. Andi loses printout is very well into our browser. Save the file on Goto Our project fuller. And don't look on this wild. Open this up in the browser and let's see how it looked like now, as you can see, it's print out the qin It actually not print out five plus five takes. It actually print out the quite Plus five value, which is 10. So this plus sign is called Operator. Now let's say you want to multiply this five and five. So what I have to do? We just add star instead off this plus and save the file goto over brother and reload the page now, as you can see, here we have the value right into five is 25. So in this way we can use this operator. You also have operator called miners and save the file Goto over browser on reload up it. Now we expected five minus five is zero, so it will display the zero in our browser. And if you want to divide, just add a slash. Let's say we have 25 divided by five on. Let's go to our browser and reload the page. Now let's see how it looks like now as we expected it out. Put the fight. So in this way you can use this operators inch Allah script. Also, let's see this. A burger is actually working with the dissonance numbers or not. Let's just live here. 26. Divided by five on. Let's see how it looked like into your browser. Could our browser and reload the pitch? Now, as you can see here, it's also working with the dismal number. It just give us the output. Five door to Andi now lives a strike. A model is operator. There's just add a person insane instead off these division and let's see how it looked like indoor browser, said the page and goto our browser on Reload the page. Now it give us a one. So in this way we can use these operators on one more thing. I will show you where is, which is called Something like Implement and Dick lament operators. So let's say we have a very well which hold 26 value. Now we want toe increase this very well by one into our brother. So what I have to do is we have just Stipe the available number on. We have to just type the plus sign twice. And what this does is it just increased this value by one. So let's stick it in the browser, said the file and goto our browser on Reload the page. Now, as you can see here, we have drinky seven output into our browser. And if we just change this value to doing this statement, or let's say doing the eight and save the file, go door Broza And it just reversed 29 we also have a Dick Clement operator instead of this double Plus, we want toe add double minus on, and what have to do is sit the file and goto our browser and we load the page. Now it give us a 27 value, which is a Dick Clement by one in this value. So in this way you can use this inclement and equipment as well. Don't worry, guys. When I teach loops in later videos this inclement and document Wilmore woman into your guys . But for now, keep it in your mind. You can use this type of operators as well. 9. How to Used "If" & "Else" In Javascript: All right, so in this video, we're gonna be learn about something called FL Statement. So first of all, I'm gonna go to my project Fuller and copy and businesses to milk. Welcome hair on. Rename it to index hyphen. Do you hoping pills, hyphen, statement and wreck. Click on this file and open it in north for trespass and first herbal. I'm just removed this variable from here because we don't need it. Andi Now list a cold. He feel statement. You feel statement? Actually, you can tell JavaScript to make a decision. It works something like this. You can tell Joe Skip something like this. If this is true, then print out this program into the browser. And if this is fall, then print out another program into the browser. So let's just create a symbol evil statement here on Let's see how it looked like and how it walk in javascript. So, first of all, I just create toe really wills over here. Let's just create a Greeleyville X and then give it a value, something like 11 on, then honor next land and create a new variable called y on. Then give it a value. Something like 19 and after that is just create a if statement. So if statement is always start with the if keyword solicitous type. If then give the fantasies on, then give the curly bracket. So if the condition is this, the condition will go into this trend is racket and if the condition is true, then run the program. So what type of program is run when the condition is true? Is going toe this curly bracket? So let's just try a simple condition over hell is just type here x, then double cool too. Why why we need to add double equal here because we already walking with a single equal signing toe are variable. So do we makes your that JavaScript will identify the exact value off this true very will you have to add this double equal sign here it mean match the x and y value exactly same or not. So if x equal to why run this sticks. So let's just print out some text. So let's just add document Dordt, Right. Turning to this document that right in the double condition, we just add something like X is equal toe. Why? So if x equals toe. Why that mean X value is a called a wife value, then Trent out the Sticks X is equal to why in tow our browser. And if this value are not the same, then print or nothing simple. So let's just say the file and it is this programming tor browser. Let's just go to our Project folder and double click on this file. Open this up in the browser and let's see how it looks like. So now, as you can see here, it brings out nothing indoor brother. Why? Because the X value are not same as the y. So let's just add the same value into this true, really, Even which is 19 and save the file and go to our browser on Reload the page. And let's see if this print out the stakes are not. So. This is reload the page, and now it brings out the Value X is equal to why now, as you can see, if this value are true, we can only print out districts into a brother. And if the value is falls, we print or nothing in for Rosa. But I want If the value was falls then we also print out something into our brother. So how we can do that now it's come to our ale statement. If this value is true, then print out this ill. Then we need to open and closing our curly bracket and into this curly bracket we need to add our fix, which is X is not equal toe. Why? So what this program does is if x it will do. Why means X value is equal to why, then print out this fix, which is X is equal to why on, and if the value are not true, that mean X value is nautical do. Why then print out this sticks, which is X is not equal to why it working something like that. If the condition is true, then print out this value else. Print out this well, so let's try it in your browser. Stepped the file and go to our browser and reload the page. Now it can print out X is equal to white because eggs variable and y valuable value are the same. Let's just change this value. Let's exchange this extra 16 and why to 19 and print out this value in tor browser on Let's see how it looked like. And when I reload the page now, it can say X is not equal to why that means it can print out this Ailes value. So in this way, you can tell Joss Skip to make decision for you using if an else statement. And also one more thing. This condition is not limited. Toe this equal sign. You can use exploration sign and equal sign which refer toa not equal that mean, if x nautical do, Why didn't print out this value else? Print out this value you can also use getter than or Lisbon sign. So in this case, JavaScript will read this court something like this. If X is get it, then why then print out this value else, print out this value you can also use. Listen, sign as well. JavaScript will read discourse something like this. If eggs value is less than why then print out discord else print of this court. So in this way you can use this if l street men in your javascript 10. How to Used "Switch" In Javascript: All right, so now we know what is. If l statement on in this video, we're gonna be Look at the switch. So this is good or project cooler on dcaa p. And is this a steaming pile over hair and renaming to in next hyphen? Switch on record on this while and open it in north. Back plus plus. So now let's say we know how to use the full statement, But let's say you want a multiple, even ill statement in a program. Let me a straw. You first how it looked like now, as you can see here we have some couple of lineup. He fell statement, and it gives us the same output type as we want. But this is not always the best solution, especially when you hold multiple of values on a single variable. So now in hair, the switch coming which will handle exactly the situation and it does so more efficiently. Then they're repeated. If l stedman the first of all, let's just create a simple switch and take a look at how it looked like and how it works. So, first of all, I'm just delete this reported line off vehicle statement from here. And we just live with the single really will which called X on. Let's just change this value to a stream. We just type red. And when you start opening a switch case, you want to type the keywords which is rich on Ben. You have to open. Your friend is this. And then he helped open your color bracket and into this friend disease you have toe type the very real name on nothing else. Execute. So that or why you called so that it is not like that on into this curly bracket. We just type some cases which hold our values. So type our cases. You want to type gifts, then give us space. First we type the world called red and instead off semi colon. We just live here Colon on in the next line, we just die document dot Right, Andi, into this friend Aziz, This open our double quotation into this conditional is just type. This'll is read on. Give us Temic alone. After this, Document it right on. Let's just type one more thing, which is Brick. I just tell you in couple of minutes why we type break after this document. Not right. And let me just copy this case some couple of time. One, then I need another one. Then we need another one, and that's it. And change this. His name do One is blue. Well, the change here. You, um the you low also hair you as well on then black, um, like as well on. Just give some species so looking nice and pretty All right, so let me just explain this court hair. So we have some couple of kids under this rich, and what switch does is which find the world within this variable X, which is red. And when they find the world they can display, this sticks into the browser. And this is the simple program. So why we add the break after the old case? Because when the switch find award that we're looking for, they can stop the program and don't goto the next lines so it can save your lots of time. That's why we can add the Breaky Ward after the cases. Let me just show you. Let's just change this cure toe blue. So when the switch find this blue ward because we're targeting eggs variable and eggs very well. Hold this blue world. So switch is searching for blue. And when they can find this blue into this second case, there does not go to the third and fourth case because they are find our ward. And when they find our ward, they can display the steak. This is blue into your browser on bacon. Break the program in this line and does not go through this line so it can save your lots of time. So that's why we can add this break cured after the all cases. So let's just try this simple program into your browser. Let's just save the file and go door project Fuller. And don't look on this file and open this up in the browser and let's see how it look like now you can see, as we expected is just display their text Indoor browser. This is blue. Now listen good or takes a leader on, and let's try something different. Let's say we have a value into our very well that's does not include in this case. It's just type. One more color here that does not include in this case is I agree on this curricular is not including this cases, as you can see here for stone is red and blue, then yellowed and black. And there is no great cases, so switch will not find this great value into their cases. So let me just show you how it will displaying to the Broza. So sleep the file and goto our browser and reload the page and let me show you how it looked like. And as we're going to see here, it display just nothing because which will find nothing value into their cases. So they will display nothing into our browser. So in this case, I only saw something into the browser if which will find nothing value into their cases. So let me just add a default takes for you, which will apply when switch will not find the value into their cases on that should remember that default value is your last line into your switch so you can write your cases . Then you can add a default value. When switch could not find the variable value into their cases, they will display that before takes or default value into the browser does the point. So now let me just add it to call value into the stretch. So if you want to add it, the fall fairly windy will switch. You just type the key word default. Then you want to type a colon, not a semicolon colon as like the kisses on. Then you have to write down the document dot Right? Let me just copy this document that right from hand tested over here and changed the sticks to Saudi we could not find in color. That's look nice. So, as we say, when switch could not flynt this value into their cases, they can Onley display these default takes. They can display this deported taken into the browser on As you can see here, we do more at any brick into our default because I already said before default is your last line. Default should be your last lining switch, so Wednesday's did not find the value into their case. They can display that before text. So, as you can see here, we try with a different color, which is the different value. This does not include in this switch cases, so we hopefully it can display that before text. Let me just try it in your browser, save the file and go to our browser and reload the fish. Now, as we're going to see here, it is rather take story. We could not find any color. So in this way you can create and use switch in JavaScript. But you should remember that, as I said before, your default takes or your default value should be your last line into your switch. Andi also, it does not record any break keyboard because this should be our last line. If the switch will not find the value into their old cases on Lee, then they can display the default text, so you should remember that. 11. "For Loop" In Javascripts: All right, so in this video, we're gonna may learn about something called looks. Looks are very important. And very you school when you want to repeat something repetitively So, Mrs Goto, my project fuller on goingto copy in his nest Immel file over here and rename this to in next heist Man four hyphen Luke. Because we learned for Lupin this video. So I'm just right Click on this file and open ating. No back plus plus. And first of all, I'm just delighted days switch home here, so let's just create a simple example for you. Then we have to start the whole new note, right? I love rate cooler. All right, so now let's just load this page in your browser. So let's see how it looked like on don't go on this while companies of in the browser and as we expected, is just bring out the text into our browser. I love red color. Now let's say I need the sticks. Ah, Kenton. So how we can do that? We just go over text editor and copy this document Not right on bested here, Stendardo and save the file and go to our brother and reload the page. Now we have some couple of mystery takes over here, but this is also look very messy into our quarter here as well as you can see here, we have a couple of some document that right document. Right document dot Right. And it looks also unprofessional. So there is another way to repeat this text. Repeat any type of elements. Any type off tens in charge, a script which is a for loop for look and help you to repeat anything. Do any number of time. Just type being one. Sing a line. So let me show you how to create a four look. You want to type the key word for then give us this, then open our friend of this on Ben U S space and then open our curly bracket on into our curly bracket. Is this type our document dot Right on we take this name takes indoor document dot Right, Which is I love rate killer. Then give us chemical enough that this document, right? And into this four loofa entities, we just add a couple of variables over here on. Remember this thing for Luke? Want some variable to work So you want to add some very well here to work with this call you. So let's just add a y variable over here and let's give a equal sign and then I just add zero, because in programming number, start with zero. So why he called to start with zero, and we need another perimeter over here, which is why is less than you live in. So what this still of browser is friend of this line? Whatever time either it will reach less than 11. That means his tender in the standings listening 11. So this line will print out 10 times in tow, our browser. And now we need to add another perimeter over here toe automatically increase one line after this zero because this line will start counting from 00 than one, then two, then three, then four, then five on that will print out this line Either each will reach less than 11. So we need to hair at another perimeter which will automatically increase our line. Whatever, this text will restore less than 11. So this parameter is called. Why Plus plus, as you can see in the previous video, this plus stress will automatically increase one number, as you can print out in our browser, so this will automatically increase a line whenever this text will not reach to less than element now. A listers had another thing here, which is a line break because we want each and every line separated for mothers. So let's just aired online break after this ward on a B, uh, giver Andi. Then save the file on Goto our project polar and double click on this wild openness of in our browser. And let's see how it looks like. Now, as you can see here, we're just print out the 11 lying Tore browser. Why we print only live in lining Tore Rosa, I can tell you before we air printout just only 10 as I mentioned before in programming numbers are started with zero. So in this case, it will print or something like that zero, then one than tooled and treating four kuip, 6789 10. So in this way it can trained out that 11 line because coastline is counted at zero on the last line. Counted as Stine, so it will print out that element line on if you want something like 50 line. So how you can do that? Just change this living to 50 or whatever number you want. You also can print out thousands of lines or whatever number you want. Just put it over here, and it can print out those line into a browser within few seconds. So in this way, you can create for loop on, use it in JavaScript. 12. "While Loop" In Javascripts: All right, so in this really we're gonna be learn about while you So first thing first this good work with your cooler and create a workable copy for this. A Stina document and 52 were here on Rename this to in Next Life in Why loop dot a steamer on rhetoric on this file and open it in. No trust us. So first of all, I'm just removed this or look from hair. Now let's talk about the wild Blue. Why Luke are the same as like the follow Actually, loops are the same kinds, but this is a different loop, so it has difference in text and perimeters. So let's just type our why look here and just reading or browser. So let's see how it looked like. So, First of all, we need a very well to working with a while loop. So listens. Create a simple variable of war and give a why name, then equal do on in hair. We need to put the value. Let's just go. The simple valuable it's ah one. And we need to start of a while loop. So if you want to type your why look, you want to start typing the key word while then you have to open your friends. Is this record. Then you have to open your curly bracket and into your apprentices record lizards type. Why lays then then and into your curly bracket? Let's just print out something. Let's just time document dot Right on into this document. Don't, right. We just want to type are very evil name, which is why then if you want to add some text, you also connect the text. Just give us strays than at a plus because we are adding that text with this variable value . So you have to have a class sign, then give us space, then open your double quotation and into a double conditional is just have something like dime love recordings. So we have to Taipower takes over here on. Then we have to open up lane record as well. The, uh and that's it. And we need to add another thing which will automatically increase by one for this document . That right, which will Why? Plus Plus, we don't want to type this y plus Plus, in this Prentice's record, we on toe type this after this document that right inviolable and then slipped the file on Goto our project folder and double click on this Wild Open this up in the brother. Let's see how it look like now you can see here while will print out this document Not right nine time because we are adding here. We want this value. Either it will reach less than 10th. So nine is less than 10 and when it will go to the 10. So why liberal identify 10 is not less than 10. 10 is actually equal to 10 while loop will stop. So when this value will reach out the nine time if you add 20 in hair so it will print out this value 19 time Because we are I need this value less than 20 times 19 is less than 20. So it print out the 19 time this value into our browser. So in this way, the while you were working in javascript and you can create this wild loop and use it as they want 13. "Do While Loop" In Javascripts: Alright, guys. So now we know why. Luke for loop. And in this video, we're gonna learn about do I look so first thing first, let's go to our project Fuller. Andi, copy and busily stimulate document here and rename this to do. Hi, friend, while I felt low. That's very nice on right leg on this file and open it in north back plus Plus. Now what is do? Well, you do. Why? Luke are the same as like the boy, Lou. But do I look print out something before they want to test a court as we see previously. Inviolable in for follow. First of all, the while, loop in for loop will get something than print out into our browser. But for do well loop, it can print out something into our browser. Then it can be test out our core. So let's see how it looked like. First of all, understand movies. Why look from here and we can stick with this variable because we need a variable toe run. Our Do I look, Andi, I just do this one thing. I just do a simple change over here. Just change the value toe. Something like to like. So now let's just Taipower do well. So you want to type you, do I? Look, you want to start with the keyword do, Then you have to open your curly bracket. We don't need any fantasies there. We just need the color bracket, then into the car. Live record. Let's just I document dot right on, then the Francis's record and into the franchises record we have toe written our Viva. Why, then you also gonna add some funny texts with this wife value, so they just add something like time high on. Then we also add Viet Dag after the text. No, we have to write a stem ical enough to this document that right? And now we have type. Ah, while you. So let's just type while Andi then who have open your friend is his record. And in hair, we have toe give something which will noticed this loop. Let's say, why is Liz then 10 and then we have to write our cynical We don't need any more curly bracket after this while and also we need to add another thing which will increase this document number by one, which is the white plus press. Andi, sleep the file. Go to our project. Fuller on Don't look on this world. Open this up in the browser and let's see how it look like now. As you can see here, it can print out the value, either ritual reach nine. So to time high, because we start with the two so it will print out to first. So to time high three time higher to nine time high. So what this court till the browser discord until the brother first print out this value into our browser, then test out this wild condition on, then print out those value. Either it will reach the nine because we want the Y value. Listen 10. So it will stop the program when it will raise to nine. So I just show you something, which is pretty much interesting. Let's say we need a value hair, which is a getter than then. We have distant here, so if we using for loop or while Lou, it will print out nothing in tow a browser, but for do while loop, as I said before, it will print out something in your brother cause then it will taste the condition. So let's just try the same thing, which is? I just put something bigger. Hair, which is 12 12 is obviously bigger than the 10. So let's justice this court indoor roser and let's see how it window into our brother listens Goto our brother on Reload the page. And as you can see here, it bring doubts still, 12 time high. Why? Because, as I said before, it will print out at least one lining toe a browser dentist, the court so it will print out the value first in your browser. Then it will does the scored. Why is within 10? And, as you can see here, why is already legal to 12? So it went out Nothing after this document that right after this first line, so it print out still of one lining door browser. So do I. Look, it's pretty much helpful when you will print out something before you want to taste your court. Let's say you want to print something before the page Lord using JavaScript, but you can use this. Do I look toe print out some text like your Villager will cost. See that takes your pages loading. Then the bridge will lower something like that. So this do I look will helpful when you print out something before you want to taste a court. So in this way you can create your do I loop and use it into the JavaScript. 14. "Arrays" In Javascript: Alright, guys. So now we learn how the loops air walking in JavaScript. So in this video, we're gonna be learn about something called a raise. So first thing first, let's go to our project folder and copy and business fell over hair and renamed it to Index . Hi, friend. That is on directing on the smile and open it in north back plus mus. So first of all of this is moved. These do while looks for mayor because we don't need it on now. A list of old bodies areas It is our pulled multiple values in a single video. Let's say you have a variable over here. Let's get a reliable simple enough making a name for its Andi Make of value like 24 and Liz , this friend out this very willing your browser. No, carmen dot Right then, variable name on. Let me go on after Bend, save the file, but our project cooler and double click on this file it. Open this up in the browser on as we expected. It's a sprint out that 24 which is the value for this variable. Now let's say you have some multiple very well over here like 24. Then you have 48th and 59 57 60 or whatever values the one. Let's say you have some multiple fellas over here and let's just print out this indoor brother and let's see how it look like you said the file and go to our brother on Reload the page. Now, as you can see here, we print nothing in browser because javascript will confuse. What the heck is this? You have to print 24 or praying 48 or 59 57 60. What type of value you want to print in your browser. Now, in this case, double script will have the areas that is will help you to store multiple values in a single Really, really. So let me just create a simple Eric for you. So it will riveted to understanding he was how there is a walk. So before you want to create an area, you obviously need a variable. Then you have to give equal sign. Then you have to type in either blue, which is new. Then you have to type here a use capital war, then doubler a why, which is Very. And as you can see here, I just capitalize That e later. Javascript is case sensitive. So you have to be careful in there. Whatever you have to type small later or Capital letter and is are all small letter instead off this, the leader the leader are in caps. So remember these guys Now we have toe open our friend Mrs Racket and into this Prentice's we have toe type our values. Let's see, Let make it more logical lives the giver. Very well named two names eso provide him name on. We have to put some names in these areas unless of excess. Those name indoor browser one by one. Now let's just axum names into this area. Just add a false name, John. Then give a comma. Then you were singing name Anna. Give a come up and then give 1/3 name. Rick. Andi, that's it. Now you go ducks me. We have three names into this very vehicle name. But how we can access each off this value. Like if I want to access the John how we can access the John Value because we just print out the variable name. So if I print out just only the variable name it print out. Nothing indoor browser because we don't indicate javascript toe print out exactly this value because this name will hold three values, as you can see here. So how we can access those three values separately when you put your values into the airy and we will identify each values, like at a index. So this is in next one. This is in next to this is indexed tree. And when come to the computer program computer program are always start with deal, as I mentioned before. So in this case, this is zero. This is one on this is true. So if I want to access that John Value I want do type here first is name, which is a variable name. Then we have to open our square brackets and into the square bracket. We have to give the next name, which is zero, because we have to access the zone value and John Index is zero. As they mentioned before, computer program are always start with zero. So this is zero and this is one on this is to let's just change this name. Very real names. Now it looks larger, girl, because we hold more than one name, so names this pretty good. We also change here names as well. Now save the file. Now go to our Forget Fuller and double click on this file to open this up in the browser and let's see how it looks like. Now, as you can see here, it just brings out John as we expected. Now let's see if I want to change the index number. Tow something else like, let's say I warned Output the Rick name. So I just want to change this to two because Rick in next number is 201 to so Rick Index numbers to. So save the file and go to our browser on Reload the page. Now, as you can see here it out, put the rig. So in this way we can create a variable and hold as much value as you want. Using air is on in this way. Also, you can create Aeneas and use it in Joe's group