diff --git a/learnjs/1. Introduction To Javascript/script.js b/learnjs/1. Introduction To Javascript/script.js index 9558d11..a881709 100644 --- a/learnjs/1. Introduction To Javascript/script.js +++ b/learnjs/1. Introduction To Javascript/script.js @@ -1,17 +1,25 @@ -let c = 12; -let d = 13; +/* Javascript is developed in 1995 by Brendan Eich to make the web pages live. It is first named Livescript and then renamed to Javascript as java was popular at that time +That's a quick history about javascript. Let's know know how to declare variables in javascript. -let age = 26; // initialisation +In javascript variables can be declared using three keywords. They are: + 1. let + 2. const + 3. var + + let and var: + There is very less difference between let and var. var is used in olden days but you can use let to declare variables. -const name = 'Anuj'; -const Name = "kumar"; + const: + Variables declare using const keyword can't be changed once they are assigned a value. So we must assign a value while declaring a variable using const + + */ -// console.log('age', age) -// age = 28; +let name = "John Alec"; +const age = 20; -// console.log("c+d is", c + d); - -// console.log('age', age) -console.log('name', name); +name = "Harry" // No error +age = 34 // Error + +