InterviewSolution
| 1. |
How Do You Compile Typescript Files? |
|
Answer» The extension for any TypeScript file is “.ts”. And any JavaScript file is TypeScript file as it is a superset of JavaScript. So change extension of “.js” to “.ts” file and your TypeScript file is ready. To compile any .ts file into .js, use the following command. For EXAMPLE, to compile “Helloworld.ts”: tsc helloworld.ts And the RESULT would be helloworld.js. The extension for any TypeScript file is “.ts”. And any JavaScript file is TypeScript file as it is a superset of JavaScript. So change extension of “.js” to “.ts” file and your TypeScript file is ready. To compile any .ts file into .js, use the following command. tsc <TypeScript File Name> For example, to compile “Helloworld.ts”: tsc helloworld.ts And the result would be helloworld.js. |
|