Skip to content

Commit 7fdfc79

Browse files
committed
javascript day1
1 parent c6ff298 commit 7fdfc79

5 files changed

Lines changed: 151 additions & 0 deletions

File tree

First Program/first.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
console.log("Nilaj");
2+
console.log("Chakraborty");

First Program/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
</head>
8+
<body>
9+
</body>
10+
<script src="first.js"></script>
11+
</html>
1.05 MB
Binary file not shown.

Variables/examples.js

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
2+
//Dynamically typed language need not to mention data type of the variable
3+
4+
/*
5+
Variable rules
6+
1.Case sensitive
7+
2.Letter digit underscore and $ allowed should be 1st Charecter
8+
3.reseverd words can not be variables.
9+
*/
10+
11+
/*
12+
13+
Data type in Js
14+
15+
Number String Boolean Null undefined Symbol Bigint
16+
*/
17+
18+
19+
//string
20+
m="tony";
21+
console.log(m);
22+
//int
23+
a=10;
24+
console.log(a);
25+
26+
//float
27+
b=10.25;
28+
console.log(b);
29+
//null
30+
x=null;
31+
console.log(x);
32+
//undefined
33+
y=undefined;
34+
console.log(y);
35+
36+
//boolean
37+
isfollow=false;
38+
is=true;
39+
console.log(isfollow);
40+
console.log(is);
41+
42+
$full=5;
43+
console.log($full);
44+
45+
z=BigInt("9");
46+
console.log(z);
47+
48+
let p=Symbol("hello");
49+
console.log(p);
50+
51+
52+
/*
53+
let var & const
54+
-----------------
55+
var: variable can be redeclared & updated. A global scope variable before 2015 we used var
56+
57+
58+
but in 2015 in javascript has new features called ES6 and we use the following keyword
59+
60+
let:variable can not be re-declared but can be updated. block scope variable.
61+
62+
const: variable can not be re-declared or updated.A block scope variable.
63+
64+
*/
65+
66+
//var
67+
68+
var age=25;
69+
var age=45;
70+
console.log(age)//45
71+
72+
73+
//let
74+
let n=76;
75+
n=90;
76+
n=86;
77+
console.log(n);//86
78+
//block scope
79+
{
80+
let o=89;
81+
console.log(o);
82+
}
83+
84+
{
85+
let o=54;
86+
console.log(o);
87+
88+
}
89+
90+
91+
//const
92+
93+
const t=10;
94+
console.log(t);
95+
96+
/*
97+
Object collection of different variables
98+
*/
99+
const student={
100+
fullname:"Nilaj Chakraborty",
101+
age:26,
102+
cgpa:9.34,
103+
ispass:true,
104+
105+
};
106+
console.log(student.age);
107+
108+
109+
const product={
110+
title:"Ball pen",
111+
rating:5,
112+
offer:25,
113+
price:1200
114+
};
115+
console.log(product);
116+
117+
118+
119+
const profile={
120+
username:"@nilaj",
121+
isfollowes:true,
122+
followers: 100,
123+
following:120,
124+
};
125+
126+
console.log(profile);

Variables/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
</head>
8+
<body>
9+
10+
</body>
11+
<script src="examples.js"></script>
12+
</html>

0 commit comments

Comments
 (0)