Go to the TypeScript playground here. Can you fix the errors?
Go to the TypeScript playground here. Can you fix the errors?
Go to the TypeScript playground here. Can you fix the errors?
Objects vs interfaces
Go to the TypeScript playground here. Can you fix the errors?
Go to the TypeScript playground here. Can you fix the errors?
Go to the TypeScript playground here. Can you fix the errors?
Go to the TypeScript playground here. Can you fix the errors?
Go to the TypeScript playground here. Can you fix the errors?
Go to the TypeScript playground here. Can you fix the errors?
- Install TypeScript
npm i typescript --save-dev
- Initialize new TypeScript Project
npx tsc --init
- Rename
index.jstoindex.tsand compile the code:
npx tsc
You can also enable watch mode by running
npx tsc -w
-
Add the compile step to the npm scripts
-
Fix the errors in the terminal, so the code will compile.
-
Add the correct types to the
index.tsfile. What types need to be added? Can you make use of interfaces, or combine types? -
Combine the requests to these endpoints so'll get one function that combines the
orderandcustomerdata in one object. (hint: there's an id for customer inside theorderrequest).