-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
161 lines (108 loc) · 2.29 KB
/
app.js
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// //firstname = "ali";
// const firstname = "hasan" + " aasd as";
// firstname = "ali";
// console.log(firstname);
// const x = "ff";
// const y = 10;
// const xy = x * y;
// console.log(xy);
// Number
// String
// Boolean
// null
// undefined
// const x = 2;
// if (x === 2){
// console.log('true');
// }else{
// console.log('false');
// }
// switch(x){
// case "2":console.log('do');
// break;
// default:console.log('none');
// }
// // for (let i=0;i<10;i++){
// // console.log(i);
// // }
// let i = 12
// // while(i<20){
// // console.log(i);
// // i++;
// // }
// do {
// if (i === 13) continue;
// console.log(i);
// i++;
// }while(i<20)
// Hoisting;
// Math.random()
//let age = 2;
// if (Infinity < 18){
// var firstname = "hasan";
// console.log(`${firstname} age is under 18: ${age}`);
// }
//age =+ "XX";
// const isValid = true;
// const firstname = "";
// const lastname = "edalat";
// const نام = (firstname && '-') + " " + lastname
// console.log(نام);
// function logname (firstname,age=4){
// function sayHello(){
// console.log('hello');
// }
// console.log(`${firstname} is ${age} years old`);
// return 33;
// }
// sayHello();
// const student={
// lastname:'rezaei',
// average:19
// }
// const student2 = student;
// const x = new Object();
// x.name = 'asdas';
// student2.average = 20;
// console.log(x);
//console.log(function1())
// function Student(lastname,age){
// this.lastname = lastname;
// this.age = age;
// }
// function createStudent(lastname,age){
// return {
// "last name":lastname,
// age
// }
// }
// const student1 = createStudent('ahmadi',12);
// student1["last name"] = "asdasd";
// console.log(student1["last name"]);
//console.log(new Student('ahmadi',22));
const person1={
lastname:'hoseini',
sayHi:function(){
console.log(`Hello ${this.lastname}`)
}
}
const person2={
lastname:'rezaei',
sayHi:function(){
console.log(`Hello ${this.lastname}`)
}
}
//call
//apply
//bind
//person1.sayHi();
//person1.sayHi = person1.sayHi.bind(person2);
person1.sayHi();
const person44={
name:'ali'
}
const person55={
name:'ali'
}
const person66 = person55;
console.log(person66 == person55);