Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions learnjs/1. Introduction To Javascript/script.js
Original file line number Diff line number Diff line change
@@ -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