Numbers and Strings
Numbers and Strings
π¨βπΌ We're building a product catalog system. Our first task is to create
variables that store product information with proper types.
We need to track:
- Product prices (numbers)
- Product names (strings)
- Product descriptions (strings with template literals)
π¨ Open
and complete the following tasks:
- Create
pricewith typenumberset to29.99 - Create
productNamewith typestringset to"TypeScript Guide" - Create
quantitywith typenumberset to100 - Create
descriptionas a string (prefer a template literal) with this exact value:Product: TypeScript Guide | Price: $29.99 | In Stock: 100
Required exports
Export:
price, productName, quantity, descriptionCompletion criteria
priceis the number29.99productNameis"TypeScript Guide"quantityis the number100descriptionmatches the exact formatted string above (including$, spaces, and|separators)
π° Template literals let you embed expressions inside a string.