-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
96 lines (56 loc) · 1.75 KB
/
Copy pathscript.js
File metadata and controls
96 lines (56 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Intoduction to js
// document.getElementById('addss').innerText='some text';
document.getElementById('addss').style.color='purple';
const number1= document.getElementById('number1');
const number2= document.getElementById('number2');
const addform= document.getElementById('addform');
const result= document.getElementById('result');
addform.addEventListener('submit', function (event){
event.preventDefault();
const sum = parseInt(number1.value) + parseInt(number2.value);
result.innerText = sum;
number1.value = '';
number2.value = '';
number1.focus();
})
// Note:Accept primitive,everything in javascript is Object.
// '' or "" =string
//datatype: string,Number,array
// equal(=) is called in js assaignment operator.
// Main Class From Here...
//Today's topic: Variables and Data Types.
// 1. Variables(var, let, const.)
// 1.var(depreecated)
//var is function scope
// 2.Let
//let x; //variable declear.
//x= 10; //data store/value
// x=20; // Update data/value
//console.log(x); //print
//sortcut
let x = 10;
x = 90;
console.log(x);
// 3.Const
const y= 80;
console.log(y);
// Note:Using Var: Depreecated Right now.
// Using Const: Array, set, map and object.
// Using Let: Everything wihtout array,set ,map and object.
// 2.Data Types
// 1.number data type
let z= 100;
let j= 20;
let h = z + j;
console.log(h);
//2.string data type
let codjogot='This is a string data type';
console.log(codjogot);
let e = '20';
let f = 'abc';
console.log(e+f)
// 20.23 / 10.50= Fraction/Floating point
//20/10=Integer
// number data type=both integer and floating point in js.
// 1.Data Types: 1.Number such as 1, 2, 3, 4, 4.5, 1.5, 3.33, 3 .....
// 2.String sush as 'hello','10',"bangladesh"......