Recall & Review
beginner
What is the command to install the TypeScript compiler globally using npm?
The command is
npm install -g typescript. This installs the TypeScript compiler so you can use the tsc command anywhere on your computer.Click to reveal answer
beginner
What does the
tsc command do?The
tsc command runs the TypeScript compiler. It converts TypeScript files (.ts) into JavaScript files (.js) that browsers can understand.Click to reveal answer
beginner
Why do we need to install Node.js before installing TypeScript?
Node.js provides the
npm tool, which is used to install TypeScript and other packages. Without Node.js, you cannot use npm to install the TypeScript compiler.Click to reveal answer
intermediate
What is the purpose of the
tsconfig.json file in a TypeScript project?The
tsconfig.json file tells the TypeScript compiler how to compile your project. It sets options like which files to include, the JavaScript version to output, and other settings.Click to reveal answer
beginner
How can you check if TypeScript is installed correctly on your system?
Run the command
tsc --version in your terminal or command prompt. If it shows a version number, TypeScript is installed correctly.Click to reveal answer
Which command installs TypeScript globally on your computer?
✗ Incorrect
The correct command is
npm install -g typescript to install TypeScript globally.What file extension does TypeScript use for its source files?
✗ Incorrect
TypeScript source files use the
.ts extension.What is the main purpose of the TypeScript compiler?
✗ Incorrect
The TypeScript compiler converts TypeScript code into JavaScript code.
Before installing TypeScript, which software must be installed first?
✗ Incorrect
Node.js must be installed first because it provides npm, which installs TypeScript.
What command checks the installed TypeScript version?
✗ Incorrect
Use
tsc --version to check the installed TypeScript version.Explain the steps to install and verify the TypeScript compiler on your computer.
Think about what tools you need and how to check if TypeScript is ready to use.
You got /3 concepts.
Describe the role of the
tsconfig.json file in a TypeScript project setup.It's like a settings file for the TypeScript compiler.
You got /3 concepts.