Приклади string і number
function sayHello(name: string): void {
console.log(`Hello, ${name}!`);
}
const personName: string = "Alex";
sayHello(personName);<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="TypeScript Project" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TypeScript Summ</title>
</head>
<body>
<input type="text" name="number1" id="number1" />
<input type="text" name="number2" id="number2" />
<button type="button" id="summ-btn">Summ</button>
<script src="app.js"></script>
</body>
</html>

Last updated