@@ -0,0 +1 @@ | |||||
node_modules/ |
@@ -0,0 +1,8 @@ | |||||
function sendRequest(data, cb) { | |||||
// ... sending a request with "data" | |||||
return cb({ data: 'Hi there!' }); | |||||
} | |||||
sendRequest('Send this!', function (response) { | |||||
console.log(response); | |||||
return true; | |||||
}); |
@@ -0,0 +1,9 @@ | |||||
function sendRequest(data: string, cb: (response: any) => void) { | |||||
// ... sending a request with "data" | |||||
return cb({data: 'Hi there!'}); | |||||
} | |||||
sendRequest('Send this!', (response) => { | |||||
console.log(response); | |||||
return true; | |||||
}); |
@@ -0,0 +1,8 @@ | |||||
function add(n1 :number, n2 :number){ | |||||
return n1 + n2; | |||||
} | |||||
const number1 = 5; | |||||
const number2 = 3.3; | |||||
const result = add(number1, number2); | |||||
console.log(result); |
@@ -0,0 +1,14 @@ | |||||
<!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>Typescript Learning</title> | |||||
<script src="app.js" defer></script> | |||||
</head> | |||||
<body> | |||||
<p> Hi </p> | |||||
</body> | |||||
</html> |
@@ -0,0 +1,15 @@ | |||||
{ | |||||
"name": "section-1", | |||||
"version": "1.0.0", | |||||
"description": "", | |||||
"main": "app.js", | |||||
"scripts": { | |||||
"test": "echo \"Error: no test specified\" && exit 1", | |||||
"start": "lite-server" | |||||
}, | |||||
"author": "", | |||||
"license": "ISC", | |||||
"devDependencies": { | |||||
"lite-server": "^2.5.4" | |||||
} | |||||
} |