-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmix.js
More file actions
35 lines (30 loc) · 805 Bytes
/
Copy pathmix.js
File metadata and controls
35 lines (30 loc) · 805 Bytes
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
async function addingNumber(n1, n2) {
return (await n1) + n2;
}
// console.log(typeof addingNumber(20, 40));
addingNumber(40, 60)
.then((data) => console.log(data))
.catch((error) => console.log(error));
console.log('Hellow World');
// Try catch block
try {
let username = "sagor",
email = "sagor@gmail.com";
if (username === "sagor" && email === "sagor@gmail.com") {
console.log("Successfully login");
} else {
throw new Error('Sorry your username and password not match');
}
} catch (e) {
console.log(e.message);
} finally {
console.log('Thank you for singin our website.');
}
// Inner function
(function saySomething() {
console.log(`Hello there, How about you?`);
})();
// with argument
(function SayHello(name) {
console.log(`Hello, ${name}`);
})('Sagor');