February 2019
Beginner
694 pages
18h 4m
English
To test this JavaScript ErrorHelper closure using TypeScript, we will need an HTML page that includes both the error_helper.js file, and a TypeScript generated JavaScript file. Assuming that our TypeScript file is called ErrorHelperTypeScript.ts, our HTML page would then be as follows:
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="error_helper.js"></script>
<script src="ErrorHelperTypeScript.js"></script>
</head>
<body>
</body>
</html>
This HTML is very simple, and includes both the existing error_helper.js JavaScript file and the TypeScript-generated ErrorHelperTypeScript.js file.
Within the ErrorHelperTypeScript.ts file, let's use the ErrorHelper, as follows:
window.onload = () => { var failureMessage = ...Read now
Unlock full access