1 Answer

0 votes
by

The extension for any TypeScript file is .ts. And any JavaScript file is a TypeScript file as it is a superset of JavaScript. So, once you change the extension of “.js” to “.ts”, your TypeScript file is ready. To compile any .ts file into .js use the following command:

tsc <TypeScript File Name>

For example, to compile “Madanswer.ts”

tsc Madanswer.ts

And the result would be Madanswer.js

...