JavaScript Full Course in 11 Hours [2025] | JavaScript Tutorial for Beginners | Edureka

edureka! · Beginner ·🌐 Frontend Engineering ·1y ago

Key Takeaways

Covers the basics of JavaScript programming, including variables, data types, and functions

Full Transcript

hello everyone and welcome to this full course on JavaScript by urea JavaScript is a highlevel versatile programming language that brings interactivity and dynamism to websites making them more engaging and functional unlike HTML and CSS which only control the structure and styling JavaScript enables real-time user interaction such as animation s popups and dynamic updates without requiring a page reload it is widely used in web development backend development mobile app development and game development and also helps with machine learning and AI its lightweight nature combined with a vast ecosystems of tools makes it one of the most popular and widely adapted programming languages now let's outline the agenda for this JavaScript full course we will Begin by exploring introduction to JavaScript where we will Define Java script and discuss its role in web development next we will cover how to run JavaScript in vs code ensuring you have the right setup to execute JavaScript programs we will then dive into JavaScript Basics covering variables data types and operators we will then shift to JavaScript Loops where you will learn iteration techniques using Loops following that we will explore arrays in JavaScript covering their structure and manipulation moving forward we will discuss substrings in JavaScript demonstrating how to extract portions of strings efficiently we will then move on to JavaScript functions learning how to define and use them next we will cover JavaScript form validation ensuring secure and userfriendly form inputs we will then explore email validation in JavaScript and then we will cover regular expressions in JavaScript which are essential for pattern matching and data validation and as we progress we will build projects starting with developing assignment game using JavaScript applying interactive game logic we will work on API projects for beginners learning how to fetch and display data dynamically next we will complete a JavaScript project reinforcing all key Concepts learned and then we will explore and advanced JavaScript Concepts and then cover the top 10 JavaScript libraries understanding their use cases and benefits to conclude we will discuss the top 10 JavaScript Frameworks highlighting their stps we will wrap up with the JavaScript inter questions preparing you for the technical interviews and real world applications but before we begin please like share and subscribe to our YouTube channel and hit the Bell icon to stay updated on the latest day content from edureka edureka's fullstack web developer Masters program designed by industry experts prepares you for the role like software engineer and full stack developer with 9 plus projects 15 plus practical use cases and 100 plus Hands-On Labs the program covers key Concepts like HTML CSS javascrip script react nodejs mongodb and many more to strengthen your fullsack development skills so check out the fullsack web developer Masters program the link to which is in the description box below now let's get started with our first topic which is Introduction to JavaScript let us understand what JavaScript is so JavaScript is an interpreted programming language used to add interactivity Dynamic behavior and functionality to web applications it works on the both client and the server site on the client site it runs directly in the browser making the web pages more interactive on the server site with the help of platforms like nodejs it handles backend operations so with JavaScript you'll be able to create Dynamic and engaging website that respond to user action making the web more interactive and functional so now let's look at some reasons why to learn JavaScript first it's easy step for beginners JavaScript has a simple syntax making it a great choice if you're just starting your coding Journey next JavaScript is in high demand it's one of the most widely used languages in web development ensuring great career opportunities it is also one language to rule them all meaning you can use JavaScript for both front end and the backend development making it incredibly versatile moreover there are great learning resources available from tutorials to documentation making it easier to master finally JavaScript has a rich ecosystem and strong Community Support with countless libraries Frameworks and an active developer Community you will never feel stuck so if you're thinking about learning programming language JavaScript is way to go so now let's set up the development environment in order to start your coding so here we have opened our vs code this is the ID that we are going to use for JavaScript and the first step is to open a folder inside the vs code so for that we will just click on file after that we will click on open folder and here you can create a new folder or you can open the previous one I have already created one new folder I will just select the folder and I will open it inside my vs code so after opening this folder what I'm going to do is I'm going to tell you about some extensions that you need to add in your vs code but you can also ignore these extensions if you don't want to add them it is okay but I will just suggest you to add some extensions like es lint this will basically catch the errors in your JavaScript and fix them and after that we have prettier code formit I have already installed it inside my vs code and you can also add one more extension that is Javascript Snippets so these are some extensions that you can add in your vs code so after adding extensions what we are going to do is we are going to create one file inside this folder let's say it would be so our file name is syntax. JS this is because first of all we are going to learn about the syntax of JavaScript so let us start with the syntax that's it so I will just save this and I will just run this code so here I can see the output so this is how you get the output in JavaScript this is a basic hello world program now let us go through it so first of all we have written console.log so console.log is inbuilt function in JavaScript that prints output to the console it helps us to display the messages debug code and test app programs so after that inside the parenthesis we have written hello world So within double codes we have written this hello world and this is basically a string which is simply a piece of text and finally after that we have saved the program so we can also add one semicolon here but in JavaScript semicolons are optional but they help to keep your code clean and readable so we have seen the output of the code without semicolon and now we will save this code and we will run it again it is not throwing in errors so basically you can see in JavaScript semicolons are optional you can keep it or you can remove it so this basic structure forms the foundation of JavaScript every statement follows the similar pattern we call a function or write an expression pass the value inside the parenthesis if needed and then we end it with a semicolon so that's how JavaScript syntax works at the basic level so now let's move on to variables in JavaScript for that I'm going to create one more file that is variables in JavaScript so my file name is variables. JS so now variables are used to store data in JavaScript and it gives us three ways to store data that is where lit and const first of all we will start with where so for where we will just write where that's it we have written it so now here where is basically a storage which is storing the data of fruit that is Apple so apple is being stored in the V so this basically is a storage so what we will do is we will save this code and we will run it so we cannot see any output because we have not written console.log we'll just write console do log fruit that's it we will just save this code and run it again after that we can see the output here that is Apple so this wear allows both reassignment and redeclaration which can lead to unexpected bugs that's why we avoid it in modern JavaScript after that comes let so we will just write let so that's it again we will just copy this and paste it console.log scode that's it save this code and run it again we can see the output here which is 100 so here let is flexible because we can update its value but we can't redeclare it in the same scope which helps to prevent any mistakes so this is about let we have seen the two types of variable declaration that is where and let and let's move on to the third one that is const that's it we will just save this code and we will run it so here we can see the output which is 3.14 so these are the three ways to declare a variable in JavaScript that is where lit and const and also const is a constant meaning once we assign a value it can't be changed or redeclared this is perfect for values that should stay same like configuration setting or mathematical constants now that we understand variables let's talk about data types in JavaScript JavaScript basically has two categories for data types primitive data types and object data types so now we will make one more file and we will name it as data types. JS so first of all primitive data types so these are most basic data types in JavaScript they store single value and are mutable meaning they can't be changed after they are created so now that you know the primitive data type let us look at the example so these are some primitive data types so first of all we have string after that we have number after that we have bant then bullion then undefined then null and then symol type so basically the string tells the sequence of the character so to write the sequence of the character we use string after that is the number type any number including decimal and all can be stored here and after that we have B so this is basically used for very large numbers after after that we have Boolean type so Boolean type will always give the output in only true or false so after that we have undefined so the variable that hasn't been assigned a value yet is stored in undefined type after that we have null type that represents an empty or unknown value and after that we have this symbol type which is for The Unique identifier so we can also check the types of these string using the type of operator so we have not covered operator yet so we are going to skip that but in case you want to check the type some of you may have the idea of operator so for that I'll just give you one example we will just write console DOT log and we will write type of string type and we will save this code so before running this code we will just comment this out so one more thing that I want to tell you is how to comment in Javas cript so to comment in JavaScript we can just go to that line and we can press two times forward slash that will comment out that line but if you want to comment the multiple lines what you're going to do is you're going to select that and you're going to press control and forward slash one time that's it and that will comment out those whole line and after that again if you want to uncomment these lines you are going to select the lines and you have to click control+ forward slash again and it will uncomment that so that's it we will save this and we will run this code so now let us look at the output here we have commented this code and we have written the we have used this type of operator to know the type of the string that we have written here so now we will just run this code and here is the output so it says string that means it is telling the data type which is string so type of the string type is string I hope you get it so that's it this is how you can know the type of the any data type so for this also you can just use console.log type of number type then it will give you number and after that you can also use console.log type of begin then it will give you begin so this is how you can identify the data types in JavaScript by using the type of operator so that's it about the primitive data types we have this all primitive data type now let us move on to the next data types so before moving for forward one thing to know about null is that even though it represents an empty value JavaScript incorrectly considers so this is not as a bug in JavaScript but we work with it so the next type of data types are object data types so object data types are more complex data structures they can hold multiple values in key value pairs so we will just see some main object data types so for that I'm just going to write one line here that's it so you might be wondering why I'm getting this code suggestion so that is because I added these two extensions in my vs code that is codium and mentaly code writer I was working on a project and for a smoother experience like we all know now a days we are working with AI and generative AI is at its boom so we can also include generative AI or AI into our IDs and we can do the coding more efficiently and also I was working on a project and for that reason I added these extensions in my vs code so if you want to know about these extensions you visit the codium website and this is just the extension of vs code that is mentaly Doc writer that's it these are the extensions that I have added that is because I'm getting the code suggestions here so now we will just look at the object data types example so we will just write cons so this is basically an object with key value pairs here we can see the name pair and the aid so these are basically the key value Pairs and we can just create one more that would be const so these arrays are the type of the object so this is how the object data types work these are basically more complex than the primitive data types and in normal coding we only use the primitive data type so for a beginner you just need to study about primitive data types and once you have covered these arrays and objects after that understanding these object data types would be easy for you so just ignore this part for now you just don't need to get into that object data types and all for now and after you have covered the topics of array and object it will be easy for you to understand the syntax of object data types so these are just basically the two examples of data types in JavaScript we have seen the both first one is primitive and then second one is the object data type so we also have some more object data types like function data type and all so for now we will just skip that for now you just need to focus on the primitive data types that is number bant bullan undefined null and symbol and even from these you need to focus on number bant bullan null and also string of course so these will be more useful in day-to-day coding so that's it about the data types in JavaScript let's talk about the operators in JavaScript so so for that we are going to make one more file that will be operators. JS that's it now first of all let us see what are the operators in JavaScript so operators are simple that perform operations on values or variables JavaScript provides different types of operators and here are the key ones so the first one is assignment operator which is used to assign the value to the variables for example is equal to assigns the value like let X is equal to 10 we know that after that we have compar comparison operators that helps to compare values like checking if two numbers are equal with double equal to or triple equal to we will just look at the example after this and after that we have arithmetic operator which is used for basic mathematic operations like addition subtraction multiplication and division after that we have bitwise operator that works at the binary level mostly used for advanced programming scenarios after that we have logical operators which is used for conditions like and or or not and after that we have conditional operators also known as tary operator it helps in writing short conditional expressions like condition then we will give value one and after that we provide value to and then just a question mark so this is basically the synex you won't understand right now we will just look at the Practical after that at last we have string operator mainly the addition operator which helps to concatenate or join these strings like hello to the world resulting in hello world so each of these operators play a crucial role in JavaScript coding now let us see some more example to understand it better so now let us look at some of the operators so first of all we will start with the arithmetic operators so arithmetic operators are basically plus minus division percent or multiplication so these are basically the arithmetic operators let us look at the example so here we have written let a is equal to 10 + 5 and then we have written let B is equal to 2 into 3 so here this plus sign is an arithmetic operator so here you can see we have used double sck that means it is used to give the exponential power to the variable so we all know the output here so here the output will be eight so these are the arithmetic operators so now let us move on to the assignment operator so here I have written let X is equal to 10 that means 10 is being assigned to X for that we have used the assignment operator that is equal to so this is the assignment operator so once again we will look at add one more so here we have assigned X the value of + 5 and we have assigned the x value multiply into 2 so here the output will be 15 that means X is 10 and + 5 would be 15 and after that X is 15 now and here we have provided the multiplication and it's into two so the output will be 30 so I hope you are understanding this first of all we have provided the value to X here that is 10 after that we can also give the assignment operator like this or we can also give the assignment operator like this so these are basically the syntaxes so if you will practice more and more about the syntaxes and the structure of JavaScript you will get familiar with the syntaxes and structure so here we have added five to the x value so the x value currently we have is 10 and after adding five it would be 15 and after that we have multiplied the same x value to 2 so the output would be 1 here so now let us move on to the next operator here we have covered two operators that are arithmetic operators and assignment operators so now we will go to the comparison operator so for that I have just written console.log 5 is equal to is equal to 5 so for one more reference I will just write console.log 5 triple equal to five so now we will just print the output so here we can see that we have written console. Log 5 and then we have provided the assignment operator and then five and after that we have written five and triple is equal to and five so in this both cases the output would be different so now if you know the answer please comment down in the comment box and if you don't know the answer we will just go through it so these are basically two types of comparison operators the first one we have to is equal to so it basically checks the equality but it is loose so it basically ignores the fact that we have written the string here we have provided the five inside double inverted commas which makes it as a string it will basically check that here we have five here we have five so it will return true that is why we say that it shows the loose equality after that we have here triple is equal to so this basically is the comparison operator that has strict equality so this basically will give the output of false because this operator will not ignore the fact that this is five in number value and this five is in string value and it will give the output as false after that one more comparison operator we have that is greater than so in this case the output would be true because of course 5 is greater than three so now let us move on to the next operator that are logical operators so for that we are again going to write console.log true and here we have used the and operator and we have provided true and false so now if you guys are familiar about The Logical operators so which we also have covered in class 8th or 10th so basically we have replaced the 0 1 1 1 1 0 with true and false so we all know that what is the output of true false using and operator which is false and again we will see one more so again if we use true false with the or operator then and the output will be true so to learn this concept you have to go through your old books because we have been taught in class 8th 9th and secondary education that what are and operators what are or operators or what are not operators and all so again for one more example we have this not operator here we can see not true we have written this not true so this will basically give the output as false so now that we have covered The Logical operators let us move move on to the bitwise operator so for bitwise operator I'm just going to write five and one and after that one more we are just going to write five or 1 so here the output will be and one and here the output will be r five so if you know about the bitwise how it is performed at bit by bit level you will get to know about this output and if you don't know about this so you just need to cover the concepts of computer architecture and by that you can just easily grab the bitwise operator so now after that let us move on to next thing that is turny operator so for that I'll just write let AG is equal to 20 and let status is equal to age less than 18 adult or minor that's it so this is how the Turner operators are used these are basically the short way to write about the conditional statements so here what we have done is we have given the age 20 and after that we have again created one variable that is status and inside that we have mentioned if it is more than 18 then the result will be adult and if it is is equal to or less than 18 it will be minor so after that we have the type of operator which we have already seen but we will just look at the output here so here we have written console.log type of hello and console.log 5 instance of number so that's it and here we know that the output will be string here and the output here will be primitive data type that's it now what we have next is we have string operators left so let us go through the string operator here we have given let name is equ Al to Alice plus Smith so here what we are doing is we are concatenating these string we are using this plus sign that basically will concatenate this string that is Alice and Smith so after going through this all operators we will just look at the output so now comes the special operator so we will just write console.log so this basically checks in Array index exist distance and it will basically check if this two is in the array and it will return the value as true or false so now we have gone through all the operators we will just save this and look at the output so here is the output we can just look at it we have not written console.log after this so it is not printing the value of a and X over here it is just starting from here it is just starting from here so as I told you this will provide you True Value it is true this will give you false value it is false after that we have performed the logical operator this true and false will give you false true or false will give you true after that again we have not true that is false and then again we have this bitwise operator so after that we have this and it is giving you the type of the string again we have not given the console.log here so it is not giving me the output so here it is giving me the output type of hello which is string so here it is false because it is the primitive data type and after that we have not given console. log so we don't have the output of LSN Smith and after that we have this True Value which means that two exists in this array so these are basically the operators in JavaScript we have covered the operators in JavaScript now what we are going to do is we are going to look at some questions of operators in JavaScript there are two questions which are type of lead code questions and one question we will solve together and the next question will be for your homework you can just solve it by yourself after covering the operators just have the Practical implementation of operators and then we can move on to the next topic so we have this two questions of operators here the first question is given two numbers A and B use the modulus operator to find the remainder when a is divided by B and the second question is given an integer n return true if it is the power of two otherwise return false so we are just going to work on this question and this question will be for your on practice so now we will just solve this question now to solve this question we will make one more file we will name it as operator question. JS and now we know the question so for this question we want two variables that are A and B and after that we need to divide it so whenever you are dealing with a coding question the first thing that you should do first create the logic inside your mind so now the question that we are going to work on for that we need two variables that are A and B and then we need to print the remainder so we will just start with let a is equal to 10 then let B is equal to 3 and after that we will just make one more variable let Remer is equal to a and then we have used this module operator and then B so after this we will just print this console.log the remainder when m% a is divided with B is this so that's it so here we have given a we can just directly write 10 here because we have assigned value to 10 and we can write B but we have written this in the case let's say we are taking the input from the user so then the user gives the input and after that we have to read a then read B and then print the remainder so for now we have given the a as 10 B as3 and then we are printing the remainder a modulus B inside the remainder we'll just save this and we will just run this code so the remainder when 10 is divided by 3 is 1 so this is the output of this code we have solved the first question we have used the modulus operator here we have used the we have assigned the value first and after that we have used the modulus operator and then we have printed the result so that's it about the first question and the second question in which you have to find out the exponential power that you need to do by your own so now we have covered operators in JavaScript now we will move on to control flow and Loops so until now we have covered the syntax and structure how to comment in JavaScript what are the data types what are the operators and we have also seen one question in JavaScript so now it's time to move on to control flow and loops and in control flow and Loops the first thing that we are going to cover is conditional statements so we will create one file here we will name it as conditional dogs in this we are going to look at the conditional statements so first of all I will give you the overview of conditional statements so conditional statements basically are if else or else if if JavaScript is your first programming language then of course these words are new for you that is if else if or else so if you have studied C C++ or Java so these languages if you have studied for once also then you are very familiar with conditional statements so for the people who don't know about the conditional statements I will just give you overview so basically these are three conditional statements if else and else if so there are more but we normally work on these three so just imagine one scenario you are given two fruits oranges and apples and you given choice that you have to select one of the fruit so you will select either apple or orange right so if you will select oranges then there will be no oranges left if you select apples then there will be no apples left so I want to mention it in document let's say you have selected oranges and the value of oranges is equal to zero now so I will mention it in document as if nidi is equal to oranges and after that I will give the statement then oranges is equal to is equal to zero that means if nidi has selected oranges then the amount of oranges are zero or else I will give the else statement else oranges are 20 let's say I have not selected oranges and I have selected apples in that case the oranges will be 20 that means we are assuming that the number of oranges were 20 so I hope you understood how we use IFL statement now we will understand through example so let's say say let Marx is equal to 85 we have given one variable that is Marx and we have assigned the value as 85 so if marks is greater than or equal to 10 we will just give the statement here console.log great a okay if the student is passed with marks greater than or is equal to 9 then console. log great a that means if the marks are greater than or is equal to 9 then the student has passed with the grade A and it will print grade A else if marks greater than or is equal to 80 console Grade B and we have given one more statement that is else if if it is greater than or is equal to 80 then Grade B and one more statement elsf again we will do for 70 again we will do for 70 and at last we will do grade D needs Improvement that's it so we have written the statement of f else here we have given the marks as 85 if the marks is greater than or is equal to 90 grade A if the marks is greater than or is equal to 80 Grade B else if grade C and else d so here we can notice we have used if else if else if and else so in all these cases we are covering some of the criteria that is of 90 80 and 70 let's say the student is not meeting any of the criteria mentioned here so that is why at last we have provided one else statement that if that student is not meeting any of this criteria then they will fall into the section of else and they need Improvement so let's just save this code and run it so here it is Grade B that means the marks that we have provided is 85 so now that 85 is falling into Grade B so that's it about the if Els if and else statement so these are the conditional statements now let's move on to the tary op operator so Turner operator are basically the shortest way to write the conditional statements that is we have already covered this in our operators so this is basically the Turner operator so we will just look at one more example of Turner operator and then we will move on to the switch statements and Loops so for tary operator again we are going to make one more file here and it will be turn.js so now let's look at the turn operator I'll just close these files here let's have a look at the example of tary operator so first of all we'll start with let age is equal to 20 then let can vote age is greater than 18 yes you can vote no you are not young so that's it after that console.log can vote so that's it here is the first example of tary operator we will just save this here I guess you already understand by these statements the age is given 20 and after that we have given this tary operator and we have mentioned two of the statements here if they fulfill this age this will be the output and if they not then this will be the output let's run it so you can see the output here yes you can vote now let's look at another example let price is equal to 25 let discount is equal to price that's it so yeah that's it here again we have one more example let's move on to one more example let number is equal to [Music] 7 okay so here we have let price is equal to 25 discount price is less than 30 than 10% discount or no discount so then we will just print the discount after that one more example we have let number is equal to 7 let result is equal number modulus 2% is equal to equal to 7 if e if it is zero then even or else odd now let us save this code and we will just look at the output here now the first one of course we know yes you can vote and after that we have no discount because price is less than 30 and after that we have this odd because 7 will be divided by two then the remainder will be 1 not zero so this is all about turning operator you can just look at the synex here how do we write turny operators and that's it these are basically the short way to write the ifls condition now we will move on to next thing that is loops and in Loops we are going to cover for Loop while loop and do while loop so now we are moving on to the loops for that we are going to create one more file that will be loops. JS and inside this loop. JS we are going to cover three Loops that is for Loop do while loop and while loop so along with for Loop do while loop and while loop we will also cover the break and the continue statement so let's get started with the loops I hope you have basic idea of loop so Loop is basically running these same statements over and over again until the condition gets satisfied so let's say first of all we will look at four Loops so we will just write here console.log for Loop okay okay so after that we will start for Loop by writing four and after that we will start giving the condition let I is equal to 1 so first of all we have initialized the I with 1 after that we will mention the condition that is I smaller than equal to 5 then I ++ so this is how you write Loop first of all we will initialize the I here we have initialized with let I is equal 1 after that we have mentioned the condition here that is I less than is equal to and then we have given what we need to perform we need to perform I ++ that means we need to add the value to I so after that we will write here console. log count I so after that console. log count I that means it will print I that's it we will just look at one more example this is how you perform for Loop now let's say console. log while loop so for while loop again we will do let counter is equal to 3 first of all we have initialize the counter with three after that we will give the statement as while then we will mention the condition inside this that is counter less than zero console. log T minus counter minus minus so that's it this is how you write the syntax of while loop so here we have given first of all cut so here we have first of all initialized the counter with three after that we have given the statement until the counter is equal to zero until then you have to do counter minus minus that means we have to subract from three until three is zero so now we will move on to the next example that is console.log do Loop so inside this do while loop we will just select num we have declared num then do num math. FL we will just give one inbuilt function here so it will just select a random number and it will multiply it with five and it will print the random number until number is not equal to zero okay so we will just write console. log break example here so for break example again we are going to use for Loop so for let I is equal to 1 I is smaller than is equal to 10 then I ++ and inside this we are writing the if statement if we have used the strong Equity operator here and and console.log stopping six break that's it and then console. log I so that's it here we have seen the example of for Loop while loop do while loop and break statement one more example we will see of continue statement console. log continue example again we will use for Loop so that that's it we have written the codes for for Loop while loop do while loop break statement and continue statement so here for for Loop we have written until the I is smaller than or equal to 5 we are incrementing the I so for do while we have initialized the counter with three we will decrement the three until it is zero so for do while what we have done is we are selecting a random number and we are multiplying it with five until it is not equal to zero and for the breakes statement again we have applied one for Loop here and inside that we have given condition I is strongly equal to six then stop at six break this statement after that for continue example what we have done here is console.log continue example and we have started a for Loop here and we have given one statement here if I is strongly equal to three then skip three and continue the rest until 5 so we will just save this code and we will run it so you you can see the example for Loop we have count 1 to five okay now it is fulfilling the condition at five so it stopped here right after that you can see the V Loop example T minus 3 2 1 right after that we have do while so it is selecting the random number in between of 0 to 5 so after that we have break example it is 1 2 3 4 5 and it is stopping at 6 after that we have continue example we have written here skipping three and four and five that means it is skipping three we have just written here skipping three in place of three so that's it about the loops these are the loops in JavaScript for Loop V Loop and do by Loop so what we are going to do now is we are going to solve questions on the basis of conditional statements and Loops so let's move on to the question again we will be having four questions that means two on loops and two on conditional statements from which we will solve here one question of conditional statement and one question of Loops so first of all we have this conditional statement question this is the question that we are going to solve write a JavaScript statement that checks a student score and prints their grade based on following conditions that are if the score is 90 or above print a score is 80 to 89 print B score is 70 to 79 print C score is 60 to 69 print D and below 60 print F and this is the question given in in teacher n this question you're going to solve by yourself so now let's move on to vs code and we are going to solve this question so now to solve that question what we are going to do is we are going to make one file let's say we will write conditional question. JS so in that question we are going to use if else and else if we are going to create those five scenarios so let us get started so now we are going to start the question let us say we will just give let score is equal to 85 and after that we will create one if condition if score is greater than or equal to 90 then the condition would be console. log a after that we will create one more case else if score is greater than or equal to 80 then console. log B after that again [Music] LF 70 then console. log C after that else if score smaller than equal to 60 console.log D or else console.log F so that's it this was the question we have created this five scenarios and let us save this and we will just run this code so let's look at the output so we have given it as 85 and the output is B so that's it this was the question here we have solved this question and the second question you're going to solve it by yourself now let's move on to the loops question so for Loops also we have these two questions this is the question given an integer n use a loop to print number from 1 to n given an integer n use a loop to calculate the sum of the first n natural numbers so the first one is the question that we are going to solve together and the second one you're going to solve it by yourself so given an integer n use Loop to print number from 1 to n so for Loops question again we are going to make one more file here we will just write Loops question. JS so for this question what we are going to do is we are going to take an input from the user that is n and then we are going to print the number from 1 to n we are just going to write let N is equal to 10 and for let I is equal to 1 if I is smaller than equal to n i ++ and console.log I that's it contr + S and we will look at the output so this has been printed this is the output so that's it about loops there was one more question in Loop that you're are going to solve it by yourself and one more thing that we are going to cover in Loops is pattern how to build a pattern so if you want to get a grab on loops and if you want to build loog logic of Loops very easily then get started with patterns try to form as many as patterns you can once you have the idea of forming a pattern then you will have a great command on Loops so for understanding patterns we will just create one file here patterns. JS so there are two patterns that we are going to create here first one will be ascending triangle pattern and the second one will be descending triangle pattern so for that let's say we'll just write ascending triangle 1 to 6 so we will just write console. log ascending triangle then first of all we are going to work with loops we are working on for Loops for Loops we will just say let I is equal to 1 if I is smaller than is equal to 6 I ++ and then condition we are going to give let string space for let J is equal to 1 J is smaller than I j++ and string plus star that's it console. log string so that's it here what we have done is we have created nested Loop that means we have created one Loop under another loop so if you are familiar with nested Loop this would be very easy for you and if you're not familiar with nested Loops then let me explain you we have first started one Loop that is for Loop in that we have printed spaces first we have printed the spaces until 6 and after after that we have printed the Stars inside that I Loop we have started one J Loop and then we have printed the stars and at last we have printed the string of stars that will be in our triangle pattern now let us write the code for descending triangle from 6 to 1 console. log descending triangle so for let I is equal to 6 if I is greater than 1 iusus then again let's string is equal to space then one more Loop we are going to start that is J and we will be printing stars then we are going to write console.log string that's it this is the descending triangle pattern we will just save this and we will run it now let us look here so this is the ascending triangle pattern right right here and this is the descending triangle pattern right here so these are the two patterns that we have printed so you can just pause the video and you can go through the syntax so you need to practice over and over again to get hands on the pattern part so if you will cut so basically if you will learn how to create patterns this Loops will be very easy for you the logic building in Loops will be very easy for you once you get hands on creating the patterns in Loops so now we have have covered the control flow and Loops so in this section we have covered conditional statements that is if else or else if and then we have covered The tary Operators after that we have covered the loops for while do while and then we have also covered the break and the continu statement and also we have covered the patterns so that's it about the control flow and Loops now what we are going to do is we are going to move on to function so now after covering control flow and Loops we are going to cover functions so now this is the most important part this is where JS gets a little bit tough before this these Loops conditional statements data types operators syntax ternary operators and everything are very easy now we are going to move on to functions so in this section we are going to learn function declaration function expression we will be learning about Arrow functions parameters and arguments and return statement so these are the things that we are going to cover in this functions and now let us make one file for functions functions. GS let us get started with the function declaration we will just close these files here so now let us get started with the function declaration so a function declaration defines a function with the name and the parameters so let us now declare a function so we will just write function add num one num two and then return num one num two so so here what we have done is we have declared function num one and num two in the first line and after that we have added the return statement that is num one and num two let me comment here this is the return statement okay so now after this we are going to add the console.log so console.log addition so add five and three right so now what we have done this is the function that we have created we have first declared the num one and num two after that we have added the return statement the return statement will be num 1 plus num two so that's it and after that in console.log what we have done is we have provided the num one that is five and we have provided the num two that is three so this basically is the function that we have created and after that we have added this console.log what we need in the output so the output of course here will be eight right so that's it we will just save this and run this code here we can see the addition is a so here we declare the function after that we give the statement on which the function should be applied so this is called function declaration writing the function declaring the function and then adding the return statement to it and then after writing whatever we need the function to be executed on so after that let us see what is the function that we have declared here the function is addition of course and after that inside the parenthesis we have this num one and num two and then we have this return statement so this will basically call the function and add five and three and the output is8 here so now let us move on to the function expression so after the function declaration comes the function expression so again for function expression what we are going to do is const multiply function ab and return a into B that's it after that we are going to write console. log multiplication and then the function we are going to call which is multiply four and five so here we have written the function expression this is basically a function can be assigned to a variable so this function is going to be assigned to this variable that is four and five here we have created an anonymous function a function without a name okay and we are calling it by the multiply 4 and five so think of it as a saving a contact in your phone instead of dialing a number every time you call the saved number so that's it we are just going to save it and let us look at the output it is multiplication 20 so now we have covered how to declare the function and what is function expression now the next thing that we need to cover is Arrow function so first I'm going to write the arrow function and then I'm going to to explain it so first of all I'll write con divide X and Y and then return x / y console. log division divide we are giving the values 20 and 4 and that's it so here what we have done is we have used this Arrow function right here so the arrow replaces the function keyword first of all we have not written the function keyword here we have written the function keyword here right so we have not written the function keyword here so yeah the arrow replaces the function keyword it works exactly like function declaration but more concise so think of it as a shortcut instead of typing full function you can write a quicker version of it so we will just save it and look at the output which is division 5 that means 20 ID 4 is division 5 so this is the arrow function Arrow function is basically the concise way to write the full function nothing else so now what we are going to do is we are going to cover the function without return so now to cover the function without return we are going to write the code function greet name and console hello and name console.log greet result greet Alice that's it so here greet Alice prints hello Alice but also does not return anything since there is no return the function output is undefined so think of it as an announcement you hear it but you don't get anything in return so we will just save it and we will run it so great result is undefined so this is about the function without return and now comes the part where we are going to cover the parameters versus arguments so parameters is a placeholder inside the function and argument is actual value passed so this is the basic difference that you need to know so a parameter is a placeholder inside the function and the argument is the actual value which is passed so now let us move on to the parameters versus arguments so we are going to write a function here so we will write function calculate BMI with weight and height so these are basically the parameters right and after return we will write weight divided by height into height that's it and then we are going to write console. log BMI and calculate 70 and 1.5 to fixed one that's it we will save this code and run it so here the BMI has been calculated so here the thing to notice is weight and height are the parameters which are the placeholders here and 70 and 1.5 are the argument which are the actual value passed so here weight and height are the parameters and 70 and 1.5 are the argument the function calculates the BMI and Returns the value rounded to one decimal place that's why we have written is to fix to one that means it rounds up to the one decimal place now think of it like an oven so parameters are the dials temperatures and time and the argument are actual inputs like like cake better or the cookies so now we have covered the parameters and argument so now what we are going to cover is Anonymous functions as arguments so that means the functions that can be passed as arguments to the other functions first of all we will pass an anonymous function inside so we will just write the set timeout function console.log this runs after 1 second that's it so here we pass an anonymous function inside the set time out which executes after 1 second so this this function does not have name but still works right so think of it like a

Original Description

🔥 Edureka's Full Stack Development Course with Certification: https://www.edureka.co/masters-program/full-stack-developer-training 🔥 𝐄𝐝𝐮𝐫𝐞𝐤𝐚 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐂𝐞𝐫𝐭𝐢𝐟𝐢𝐜𝐚𝐭𝐢𝐨𝐧 𝐓𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐂𝐨𝐮𝐫𝐬𝐞: https://www.edureka.co/javascript-certification-training (Use Code "𝐘𝐎𝐔𝐓𝐔𝐁𝐄𝟐𝟎") Want to master JavaScript from scratch? This JavaScript Full Course is designed to take you from beginner to advanced level. You'll learn essential concepts like variables, functions, loops, and arrays, along with advanced topics such as DOM manipulation, event handling, and asynchronous programming. This comprehensive course also includes hands-on projects to help you apply your skills in real-world scenarios. Whether you're starting your coding journey or looking to enhance your web development skills, this course has everything you need to become a confident JavaScript developer. 🔴 𝐋𝐞𝐚𝐫𝐧 𝐓𝐫𝐞𝐧𝐝𝐢𝐧𝐠 𝐓𝐞𝐜𝐡𝐧𝐨𝐥𝐨𝐠𝐢𝐞𝐬 𝐅𝐨𝐫 𝐅𝐫𝐞𝐞! 𝐒𝐮𝐛𝐬𝐜𝐫𝐢𝐛𝐞 𝐭𝐨 𝐄𝐝𝐮𝐫𝐞𝐤𝐚 𝐘𝐨𝐮𝐓𝐮𝐛𝐞 𝐂𝐡𝐚𝐧𝐧𝐞𝐥: https://edrk.in/DKQQ4Py 📢📢Check out the latest 2025 video on Top 10 Technologies for the most up-to-date insights! 📌 Top 10 Technologies to Learn in 2025 → https://youtu.be/5kjWh8lBxC4 📝Feel free to share your comments below.📝 🔴 𝐄𝐝𝐮𝐫𝐞𝐤𝐚 𝐎𝐧𝐥𝐢𝐧𝐞 𝐓𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐚𝐧𝐝 𝐂𝐞𝐫𝐭𝐢𝐟𝐢𝐜𝐚𝐭𝐢𝐨𝐧𝐬 🔵 DevOps Online Training: http://bit.ly/3VkBRUT 🌕 AWS Online Training: http://bit.ly/3ADYwDY 🔵 React Online Training: http://bit.ly/3Vc4yDw 🌕 Tableau Online Training: http://bit.ly/3guTe6J 🔵 Power BI Online Training: http://bit.ly/3VntjMY 🌕 Selenium Online Training: http://bit.ly/3EVDtis 🔵 PMP Online Training: http://bit.ly/3XugO44 🌕 Salesforce Online Training: http://bit.ly/3OsAXDH 🔵 Cybersecurity Online Training: http://bit.ly/3tXgw8t 🌕 Java Online Training: http://bit.ly/3tRxghg 🔵 Big Data Online Training: http://bit.ly/3EvUqP5 🌕 RPA Online Training: http://bit.ly/3GFHKYB 🔵 Python Online Training: htt
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from edureka! · edureka! · 0 of 60

← Previous Next →
1 ChatGPT Not Working - 4 Fixes | How To Fix ChatGPT Not Working | Why Is ChatGPT Not Working |Edureka
ChatGPT Not Working - 4 Fixes | How To Fix ChatGPT Not Working | Why Is ChatGPT Not Working |Edureka
edureka!
2 Advanced Java script Tutorial | JavaScript Training | JavaScript Programming | Edureka Rewind
Advanced Java script Tutorial | JavaScript Training | JavaScript Programming | Edureka Rewind
edureka!
3 Java script interview question and answers | Java script training | Edureka Rewind
Java script interview question and answers | Java script training | Edureka Rewind
edureka!
4 OpenAI API Tutorial using Python | How to use OpenAI GPT-3 API - Ada Babbage Curie Davinci | Edureka
OpenAI API Tutorial using Python | How to use OpenAI GPT-3 API - Ada Babbage Curie Davinci | Edureka
edureka!
5 What is Unsupervised Learning ? | Unsupervised Learning Algorithms| Machine Learning | Edureka
What is Unsupervised Learning ? | Unsupervised Learning Algorithms| Machine Learning | Edureka
edureka!
6 Top 10 Applications of Machine Learning in 2023 | Machine Learning  Training | Edureka Rewind - 7
Top 10 Applications of Machine Learning in 2023 | Machine Learning Training | Edureka Rewind - 7
edureka!
7 Machine Learning Engineer Career Path in 2023  | Machine Learning Tutorial | Edureka Rewind - 6
Machine Learning Engineer Career Path in 2023 | Machine Learning Tutorial | Edureka Rewind - 6
edureka!
8 10 Must Have Machine Learning Engineer Skills That Will Get You Hired   | Edureka Rewind - 7
10 Must Have Machine Learning Engineer Skills That Will Get You Hired | Edureka Rewind - 7
edureka!
9 Data Structures in Python | Data Structures and Algorithms in Python | Edureka | Python Live - 5
Data Structures in Python | Data Structures and Algorithms in Python | Edureka | Python Live - 5
edureka!
10 Python Lists | List in Python | Python Training  | Edureka  Rewind
Python Lists | List in Python | Python Training | Edureka Rewind
edureka!
11 Predictive Analysis Using Python | Learn to Build Predictive Models | Python Training | Edureka
Predictive Analysis Using Python | Learn to Build Predictive Models | Python Training | Edureka
edureka!
12 Machine Learning Tutorial | Machine Learning Algorithm | Machine Learning Engineer Program | Edureka
Machine Learning Tutorial | Machine Learning Algorithm | Machine Learning Engineer Program | Edureka
edureka!
13 How to use Pandas in Python | Python Pandas Tutorial  | Python Tutorial  |  Edureka  Rewind
How to use Pandas in Python | Python Pandas Tutorial | Python Tutorial | Edureka Rewind
edureka!
14 Parameters in Tableau | Tableau Parameters Examples | Tableau Tutorial  | Edureka Rewind
Parameters in Tableau | Tableau Parameters Examples | Tableau Tutorial | Edureka Rewind
edureka!
15 Top 10 Reasons to Learn Tableau in 2023  | Tableau Certification | Tableau | Edureka Rewind
Top 10 Reasons to Learn Tableau in 2023 | Tableau Certification | Tableau | Edureka Rewind
edureka!
16 Tableau Developer Roles & Responsibilities | Become A Tableau Developer | Tableau | Edureka Rewind
Tableau Developer Roles & Responsibilities | Become A Tableau Developer | Tableau | Edureka Rewind
edureka!
17 Deep Learning With Python | Deep Learning Tutorial For Beginners | Edureka  Rewind
Deep Learning With Python | Deep Learning Tutorial For Beginners | Edureka Rewind
edureka!
18 Realtime Object Detection  | Object Detection with TensorFlow | Edureka | Deep Learning Rewind - 2
Realtime Object Detection | Object Detection with TensorFlow | Edureka | Deep Learning Rewind - 2
edureka!
19 Top 20 Tableau Tips and Tricks in 20 Minutes | Tableau Tutorial | Tableau Training  | Edureka Rewind
Top 20 Tableau Tips and Tricks in 20 Minutes | Tableau Tutorial | Tableau Training | Edureka Rewind
edureka!
20 Climate Change Prediction using Time Series | Python Projects | Edureka | DS Rewind -  5
Climate Change Prediction using Time Series | Python Projects | Edureka | DS Rewind - 5
edureka!
21 ReactJS Installation Tutorial | ReactJS Installation On Windows | ReactJS Tutorial | Edureka Rewind
ReactJS Installation Tutorial | ReactJS Installation On Windows | ReactJS Tutorial | Edureka Rewind
edureka!
22 Phases in Cybersecurity  | Cybersecurity Training | Edureka | Cybersecurity Rewind - 2
Phases in Cybersecurity | Cybersecurity Training | Edureka | Cybersecurity Rewind - 2
edureka!
23 What Is React | ReactJS Tutorial for Beginners | ReactJS Training | Edureka Rewind
What Is React | ReactJS Tutorial for Beginners | ReactJS Training | Edureka Rewind
edureka!
24 Cybersecurity Frameworks Tutorial | Cybersecurity Training | Edureka | Cybersecurity Rewind- 2
Cybersecurity Frameworks Tutorial | Cybersecurity Training | Edureka | Cybersecurity Rewind- 2
edureka!
25 React vs Angular 4  | Angular 2 vs React | React & Angular | ReactJS Training | Edureka Rewind - 5
React vs Angular 4 | Angular 2 vs React | React & Angular | ReactJS Training | Edureka Rewind - 5
edureka!
26 ReactJS Components Life-Cycle Tutorial  | React Tutorial for Beginners  | Edureka Rewind
ReactJS Components Life-Cycle Tutorial | React Tutorial for Beginners | Edureka Rewind
edureka!
27 Ethical Hacking using Kali Linux | Ethical Hacking Tutorial | Edureka | Cybersecurity Rewind - 3
Ethical Hacking using Kali Linux | Ethical Hacking Tutorial | Edureka | Cybersecurity Rewind - 3
edureka!
28 Types Of Artificial Intelligence | Artificial Intelligence Explained | What is AI? | Edureka
Types Of Artificial Intelligence | Artificial Intelligence Explained | What is AI? | Edureka
edureka!
29 Top 10 Applications Of Artificial Intelligence in 2023 | Artificial Intelligence| Edureka Rewind
Top 10 Applications Of Artificial Intelligence in 2023 | Artificial Intelligence| Edureka Rewind
edureka!
30 The Future of AI | How will Artificial Intelligence Change the World in 2023? | Edureka Rewind
The Future of AI | How will Artificial Intelligence Change the World in 2023? | Edureka Rewind
edureka!
31 What is Artificial Intelligence | Artificial Intelligence Tutorial For Beginners | Edureka Rewind
What is Artificial Intelligence | Artificial Intelligence Tutorial For Beginners | Edureka Rewind
edureka!
32 Google Cloud IAM | Identity & Access Management on GCP  | Edureka | GCP Rewind - 5
Google Cloud IAM | Identity & Access Management on GCP | Edureka | GCP Rewind - 5
edureka!
33 Google Cloud AI Platform Tutorial | Google Cloud AI Platform   | GCP Training | Edureka Rewind
Google Cloud AI Platform Tutorial | Google Cloud AI Platform | GCP Training | Edureka Rewind
edureka!
34 Projects in Google Cloud Platform  | GCP Project Structure  | GCP Training | Edureka Rewind
Projects in Google Cloud Platform | GCP Project Structure | GCP Training | Edureka Rewind
edureka!
35 How to Become a Data Scientist | Data Scientist Skills | Data Science Training  | Edureka Rewind - 3
How to Become a Data Scientist | Data Scientist Skills | Data Science Training | Edureka Rewind - 3
edureka!
36 Agglomerative and Divisive Hierarchical Clustering Explained | Data Science Training | Edureka Live
Agglomerative and Divisive Hierarchical Clustering Explained | Data Science Training | Edureka Live
edureka!
37 Climate Change Prediction using Time Series | Python Projects | Edureka | DS Rewind -  5
Climate Change Prediction using Time Series | Python Projects | Edureka | DS Rewind - 5
edureka!
38 Data Science Project - Covid-19 Data Analysis | Python Training | Edureka | DS Rewind - 6
Data Science Project - Covid-19 Data Analysis | Python Training | Edureka | DS Rewind - 6
edureka!
39 What is Honeycode? | Introduction to Honeycode | Edureka
What is Honeycode? | Introduction to Honeycode | Edureka
edureka!
40 Difference between Amazon AWS and Google Cloud | GCP Training Google Cloud | Edureka Live
Difference between Amazon AWS and Google Cloud | GCP Training Google Cloud | Edureka Live
edureka!
41 DevOps Lifecycle | Introduction To DevOps | DevOps Tools | What is DevOps? | Edureka Rewind
DevOps Lifecycle | Introduction To DevOps | DevOps Tools | What is DevOps? | Edureka Rewind
edureka!
42 Introduction to DevOps | DevOps Tutorial for Beginners | DevOps Tools | DevOps | Edureka Rewind
Introduction to DevOps | DevOps Tutorial for Beginners | DevOps Tools | DevOps | Edureka Rewind
edureka!
43 How to Create Login System using Python | Python Programming Tutorial | Edureka Rewind
How to Create Login System using Python | Python Programming Tutorial | Edureka Rewind
edureka!
44 Python Developer | How to become Python Developer | Python Tutorial  | Edureka Rewind
Python Developer | How to become Python Developer | Python Tutorial | Edureka Rewind
edureka!
45 How to become a Data Engineer | Complete Roadmap to become a Data Engineer| Data Engineer |  Edureka
How to become a Data Engineer | Complete Roadmap to become a Data Engineer| Data Engineer | Edureka
edureka!
46 Azure Data Engineer Certification [DP 203] | How to Become Azure Data Engineer [2023] | Edureka
Azure Data Engineer Certification [DP 203] | How to Become Azure Data Engineer [2023] | Edureka
edureka!
47 Data Analyst vs Data Engineer vs Data Scientist | Data Analytics Masters Program  | Edureka Rewind
Data Analyst vs Data Engineer vs Data Scientist | Data Analytics Masters Program | Edureka Rewind
edureka!
48 DevOps Engineer day-to-day Activities | DevOps Engineer Responsibilities | Edureka Rewind
DevOps Engineer day-to-day Activities | DevOps Engineer Responsibilities | Edureka Rewind
edureka!
49 How to Become a DevOps Engineer?  | DevOps Engineer Roadmap | Edureka | DevOps Rewind
How to Become a DevOps Engineer? | DevOps Engineer Roadmap | Edureka | DevOps Rewind
edureka!
50 How to Become a Data Engineer? | Data Engineering Training | Edureka
How to Become a Data Engineer? | Data Engineering Training | Edureka
edureka!
51 How To Become A Big Data Engineer? | Big Data Engineer Roadmap | Edureka Rewind
How To Become A Big Data Engineer? | Big Data Engineer Roadmap | Edureka Rewind
edureka!
52 Python Integration for Power BI and Predictive Analytics | Power BI Training | Edureka
Python Integration for Power BI and Predictive Analytics | Power BI Training | Edureka
edureka!
53 Power BI KPI Indicators Tutorial | Custom Visuals In Power BI | Power BI Training  | Edureka Rewind
Power BI KPI Indicators Tutorial | Custom Visuals In Power BI | Power BI Training | Edureka Rewind
edureka!
54 Apache HBase Tutorial For Beginners | What is Apache HBase? | Big Data Training | Edureka Rewind
Apache HBase Tutorial For Beginners | What is Apache HBase? | Big Data Training | Edureka Rewind
edureka!
55 Big Data Hadoop Tutorial For Beginners  | Hadoop Training | Big Data Tutorial  | Edureka  Rewind
Big Data Hadoop Tutorial For Beginners | Hadoop Training | Big Data Tutorial | Edureka Rewind
edureka!
56 Big Data Analytics  | Big Data Analytics Use-Cases | Big Data Tutorial | Edureka Rewind
Big Data Analytics | Big Data Analytics Use-Cases | Big Data Tutorial | Edureka Rewind
edureka!
57 What Is Power BI? | Introduction To Microsoft Power BI | Power BI Training  | Edureka  Rewind
What Is Power BI? | Introduction To Microsoft Power BI | Power BI Training | Edureka Rewind
edureka!
58 Triggers in Salesforce | Salesforce Apex Triggers | Salesforce  Tutorial  | Edureka Rewind
Triggers in Salesforce | Salesforce Apex Triggers | Salesforce Tutorial | Edureka Rewind
edureka!
59 How To Become A Salesforce Developer | Salesforce For Beginners| Salesforce Training  Edureka Rewind
How To Become A Salesforce Developer | Salesforce For Beginners| Salesforce Training Edureka Rewind
edureka!
60 Java ArrayList Tutorial | Java ArrayList Examples | Java Tutorial | Edureka Rewind
Java ArrayList Tutorial | Java ArrayList Examples | Java Tutorial | Edureka Rewind
edureka!

Related Reads

Up next
How to Speed Up Your WordPress Website with WP Rocket ⚡Tutorial 2026
Matt Tutorials
Watch →