 Hello and welcome to this video module on JavaScript in this video lecture, I shall be discussing what are the basics of JavaScript and why we use JavaScript and how to declare the variables and what are the types of variables that we use in JavaScript. So the learning outcome for today's video lecture is that after the end of this video lecture you shall understand the basics of JavaScript, the basic syntax, the declarations and the operators that we usually use while using the scripting language. So these are the contents of today's video lecture. So JavaScript is a scripting language that we usually use along with HTML to create interactive web pages. One of the most common example where JavaScript is used is the validation of data entered at user side before submission. Also we use it for changing the behavior of page elements if there is an image, if there is an icon, if there are some elements that are there on your web page and you want to change the behavior, you usually want to use JavaScript. Now JavaScript in its nature is an interpreted language than a compiled language. So it is directly an interpreted language, it is a language different from Java, nothing to do with Java, even if we have the name Java in JavaScript. JavaScript language enables to write embedded scripts. If you want to write embedded scripts in your HTML page, you can do that. If you want to write it in a .js file different from your HTML file, you can do like that as well and then import the .js file to your HTML page. JavaScript's code is executed at the user side on the web browser. This is very important to understand because you need to understand the compatibility of the web browsers before you create code to be used on specific web browsers. So this was the introduction. This is the basic syntax. So in your HTML page, you just write two tags that is script and slash script and everything that you write in these two tags are considered to be JavaScript code. So your JavaScript code can be written in this portion, in this portion that you can see here. Apart from this, if you want to write your JavaScript code in an external .js file, you can do that. And in the script tag, you just need to add one attribute src and in that attribute you need to set the path or the place you need to set the path where you have stored the .js file where the script lies, the code, the script that lies that you need to import. So these are the two ways that you can use JavaScript along with your web page. You just need to understand that the .js file must contain just the JavaScript code and not the script tags or any HTML tags. Now how do we declare variables in JavaScript? Now usually in JavaScript, variables can hold all these values ranging from integer to float to Boolean to string to date and so on. Some variables can be declared as undefined or null and also as not a number. So if you declare a variable as not a number, the type of the variable will still be number but the value assigned will be not a number. Now the variables in JavaScript are dynamic in nature. So if I define a variable, say for example, we declare variables with the keyword var. So I declare var man equals Adam. And just the next line I declare man equals, I give a numeric value say for example 100. So if you just check up the type of man after the assignment of the value 100, it will show you number because the last value that was assigned to the variable man was 100. So variables in JavaScript are dynamic in nature. So you can assign dynamic values to any variables in JavaScript. They are also case sensitive. So man here as given in this example, Adam is in small letters whereas the second variable is having a capital M. So both these variables are different. So now the first variable here holds the value Adam the second variable man with a capital M is empty. Now what it means empty if you it does not hold any value, it is having an empty value that is why I have stated here empty but even if you check it up, check up the type of the variable man, it will still show you that it is a type of string but it does not have any value. So for understanding I have written empty here where variable X is holding a number variable nothing is holding a null value because I have assigned null value to the variable nothing. So these are this is how we declare variables in JavaScript. So how do we use strings? These can be manipulated or can be used in many ways, they can be used in many ways in JavaScript. They are usually preceded and succeeded by single or double quotes. So your man is holding the value Adam in double quotes, woman is holding the value Eve in single quotes, both of them are strings and both are valid declarations. Now variable couple is a concatenation of man plus woman. So if I print this variable couple it will show me Adam and followed by Eve where Eve is concatenated to the string Adam. So this results in a concatenated string and if I want to include quotes that is single quotes in my complete string of letters I can just put it in this way starting with double quotes. Eve is called the single quote Johnny and the single quote and then later on in the double quotes and so on. So this is how we usually use strings in JavaScript. So what about numbers? Variables can be assigned numerical value also just as we assign the string value we assign the numerical values here variable X is has been assigned the value of 1 to 3 1 plus 3 to 4 3 and the sum will be stored in the variable X. Similarly variable Y will be holding a value of X plus 100. So whatever is the value of X a value of plus 100 will be always assigned to variable X. Now say for example we are we want to add up two variables whose types are different here the variable pin is holding a numerical value and the variable solapur is having a string value. So what will happen if I add up these two variables of different type? So in JavaScript what happens is if I add these two variables string will result and this will add up the values of both these variables. That means 1, 2, 3, 1 excuse me the value solapur will be appended to 1, 2, 3, 1 and the resultant will be string. So if I add a pin plus city here so the result will be 1, 2, 3, 1 followed by solapur and the entire type of the address variable will be string type. So based on the slides that we saw earlier what value will the variable 1 hold? Please note that this is the variable with the small letters. So pause the video go through the code and answer this question. So if you have clearly gone through the code and you have understood the code your variable 1 with capital O holds the value string 1 and the variable 1 excuse me is having the value of 16 plus 20 both in number type and that is being appended with the variable 1 with the capital O which is of a string type. Now since JavaScript processes input from left to right first two numbers get added to 36 there after 36 is considered as string and concatenated with 1 to hold the value 36 appended with the string value 1. So the final answer that we get here will be 36 O and E. So the solution is 36 O and E please note that if the order of input is changed the output is again affected. For example if we add up the string 1 plus 16 plus 20 now this will result in some other output which will hold the value O and E starting with the string O and E 1 16 and then 20. So this is the solution of the question. So this is how we declare Boolean variables in JavaScript we can just check up the equality that is whether x equals y or not if the values are different it will return false. Type of operator in JavaScript again is you can just check up the type of variable and the type of the variable will be returned immediately. Now type of 1, 2, 3, 1 returns number type of car here returns undefined because we have not defined any value for car if we if we just declare a variable to hold a null value and followed with a type of operator to check up the type of the of the variable it. These are the references and acknowledgments of today's video lecture. Thank you.