Skip to content

Commit 5cd685f

Browse files
committed
added practice server
1 parent 5d44155 commit 5cd685f

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

session 1/server/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<head>
2+
<script src="/index.js"></script>
3+
</head>
4+
<body>
5+
<h1>Hello World</h1>
6+
</body>

session 1/server/index.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const calculator = (a, b) => {
2+
function add() {
3+
return a + b;
4+
}
5+
function subtract() {
6+
return a - b;
7+
}
8+
function multiply() {
9+
return a * b;
10+
}
11+
function divide() {
12+
return a / b;
13+
}
14+
15+
return {
16+
add: add,
17+
subtract: subtract,
18+
multiply: multiply,
19+
divide: divide,
20+
};
21+
};
22+
23+
const cal = calculator(12, 6);
24+
25+
console.log(cal.add());
26+
console.log(cal.subtract());
27+
console.log(cal.multiply());
28+
console.log(cal.divide());

session 1/server/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "akash",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC"
11+
}

0 commit comments

Comments
 (0)