-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
73 lines (57 loc) · 1.63 KB
/
Copy pathindex.js
File metadata and controls
73 lines (57 loc) · 1.63 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
var name = "mbr sagor";
console.log("Hello " + name);
let firstName = 'mbr';
let lastName = "sagor"
console.log("First Name: " + firstName + "\n" + "Last Name: " + lastName);
let currentPrice = 0.5;
currentPrice = 2;
console.log(currentPrice);
// primitive types
let fullName = 'Md.Bozlur Rosid Sagor'; // String
let age = 24; // Number/Integer
let isSave = true // Boolean
let isApprove = false // Boolean
let getName = undefined // UnDefine
let address = null // null
types = typeof fullName
console.log(types)
// Reference types
// object, array, function
// object
let man = {
manName: 'mbr sagor',
manAge: 24
}
console.log(man);
console.log(man.manName);
man.manName = 'Md.Bozlur Rosid Sagor'; // Here change the name value
console.log(man.manName);
// Array
let employee = ['sagor', 'zia', 'saif', 'russel']
console.log(employee);
console.log(employee[0]); // index
employee[4] = 'someone'; // add value in the array
employee[5] = 232; // add value in the array
employee[6] = false; // add value in the array
employee[7] = { house: 23, road: 11 }; // add object in the array
console.log(employee);
console.log(employee.length); // array size
// add array
let newArray = ["Hello there"]
addArray = employee.push(newArray);
console.log(employee);
for (var i = 0; i < employee.length; i++) {
console.log(employee[i]);
}
// function
function getUserName(username) {
console.log("My username is: " + username);
};
getUserName("sagor");
getUserName("admin");
getUserName("hello");
function calculationNumber(firstNumber, lastNumber) {
console.log(firstNumber + lastNumber);
};
calculationNumber(20, 30);
calculationNumber(200, 100);