Skip to content

Commit

Permalink
Typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymann committed Apr 18, 2024
1 parent 31c048f commit 159cffb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions typescript/helloworld.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var message = 'Hello, World!';
// create a new heading 1 element
var heading = document.createElement('h1');
heading.textContent = message;
// add the heading the document
document.body.appendChild(heading);
6 changes: 6 additions & 0 deletions typescript/helloworld.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
let message: string = 'Hello, World!';
// create a new heading 1 element
let heading = document.createElement('h1');
heading.textContent = message;
// add the heading the document
document.body.appendChild(heading);
11 changes: 11 additions & 0 deletions typescript/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TypeScript: Hello, World!</title>
</head>
<body>
<script src="helloworld.js"></script>
</body>
</html>

0 comments on commit 159cffb

Please sign in to comment.