Typescript Demo
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 - 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(", "));
Developer | Ruslan Marin |
Username | marinru |
Uploaded | December 07, 2022 |
Rating | 3 |
Size | 2,594 Kb |
Views | 10,120 |
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!
Name | Size |
Vue.js Conditional Visibility | 1,520 Kb |
Vue.js User Input | 1,565 Kb |
A Pen by Ruslan Marin | 1,561 Kb |
Sidescroller with p5.js | 2,455 Kb |
P5.js Clock | 2,414 Kb |
Vue.js Basic Component | 1,566 Kb |
Vue.js Attribute Binding | 1,531 Kb |
BnW | 1,489 Kb |
Rotating Cubes with p5.js | 1,753 Kb |
KO Components Demo | 2,994 Kb |
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!
Name | Username | Size |
Simple Login Form | JoshBlackwood | 4,418 Kb |
JQuery FullScreen Overlay | _codemics | 2,252 Kb |
Prototype Responsive Homepage | Heyitsolivia | 7,677 Kb |
Guidepopup | Wooljs | 3,747 Kb |
Simple CSS loader. | Cabrera | 2,574 Kb |
CSS3 keyframe onload animation. | Samueljseay | 1,706 Kb |
A Pen by Adrien Clerbois | AClerbois | 6,501 Kb |
Polygon Logo in CSS | Kai | 3,412 Kb |
Pure CSS Animated Photo Stack | Depthdev | 2,486 Kb |
Beveled corners using CSS border attribute | DawsonMediaD | 2,136 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!