Typescript Demo

Developer
Size
2,594 Kb
Views
10,120

How do I make an typescript demo?

What is a typescript demo? How do you make a typescript demo? This script and codes were developed by Ruslan Marin on 07 December 2022, Wednesday.

Typescript Demo Previews

Typescript Demo - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Typescript Demo</title>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>

Typescript Demo - Script Codes JS Codes

"use strict";
// enums look like enums in C/C++/C#
var Severity;
(function (Severity) { Severity[Severity["Warning"] = 0] = "Warning"; Severity[Severity["Error"] = 1] = "Error";
})(Severity || (Severity = {}));
var MyClass = (function () { function MyClass() { console.log("constructor run"); } // "?" after a param name indicates that it is optional MyClass.prototype.log = function (message, severity) { switch (severity) { case Severity.Warning: console.log("Warning"); break; case Severity.Error: console.log("Error"); break; default: break; } console.log(message); }; MyClass.prototype.logMultiple = function () { var messages = []; for (var _i = 0; _i < arguments.length; _i++) { messages[_i] = arguments[_i]; } for (var i = 0; i < messages.length; i++) { console.log(messages[i]); } }; // This method gets a callback function as an argument MyClass.prototype.exec = function (callback) { console.log("Calling the callback"); callback(); }; return MyClass;
}());
var myObject = new MyClass();
myObject.log("Something happened");
myObject.log("Bad thing happened", Severity.Error);
myObject.logMultiple("Msg1", "Msg2");
// Fat arrow function
var callback = function () { console.log("Hello!"); };
// Passing a function as an argument
myObject.exec(callback);
var stringArray = ["Hello", "world"];
console.log(stringArray.join(", "));
Typescript Demo - Script Codes
Typescript Demo - Script Codes
Home Page Home
Developer Ruslan Marin
Username marinru
Uploaded December 07, 2022
Rating 3
Size 2,594 Kb
Views 10,120
Do you need developer help for Typescript Demo?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Ruslan Marin (marinru) Script Codes
Create amazing love letters with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!