-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2-variables.html
52 lines (37 loc) · 1.35 KB
/
2-variables.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>variables in javaScript</title>
</head>
<body>
<script>
// rules for javaScript variables:
// 1: starting with number will not allow
// example: let 1ali= 65;
// 2: javaScript reserved word cannot used as variables
// 3: javaScript is caseSencsitive
var x=3;
var y=5;
console.log(x);
console.log(y);
// for declering variables we use var,let,const
// mostly we avoid the var in programming due to it may be creat some bugs
// so we prefer to use let and const variables
// we have 7 types of premitive datatypes in javaScript
// datatypes means which type of data we can store in variables
// NNSSBBU= null,number,symbol,string,boolean,bigint and undefind these are the seven datatypes
// premitive datatype example:
let a=null;
let b=5;
let c=Symbol("i am a symbol");
let d="saleem";
let e=true;
let f=BigInt("889")+ BigInt("999");
let g // this is undefined;
console.log(a,b,c,d,e,f,g);
</script>
</body>
</html>