showing 12 lessons...
The SCSS @for directive is great when we know how many iterations are required and we only need 1 variable. What if we need multiple variables to iterate over data sets? Hello SCSS maps and the @each control directive! In this lesson, we’ll check out iterating with lists and looping over data sets with maps and the @each directive.
Typescript generics are great for writing code that accepts any type. How do we write code that doesn’t accept any type, but instead accepts a range of types? In this lesson we learn how to use generic classes, interfaces and constraints to be more specific with our Typescript generics.
It can be painful to write the same function repeatedly with different types. Typescript generics allow us to write 1 function and maintain whatever type(s) our function is given. This lesson covers syntax and a basic use case for Typescript generics.
Handling state with Typescript enums, instead of booleans, is preferred because:
- Enums are more readable
- Enums can have as many states as you need while booleans only have 2
- You only need to keep track of state with 1 variable when using enums