TypeScript · Junior · Question 34 of 75
Why install packages like @types/lodash?
- ✓Correct answer: To get types for a library written in JS without built-in declarations
- 2To install the TypeScript version of a library instead of its JS version
- 3To enable runtime type checking for calls to that library
Explanation
@types/* packages are published from the DefinitelyTyped repository and contain only .d.ts files. Many modern libraries ship their own types - then @types isn't needed. They're usually installed as devDependencies.