Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type AllowedLifts = 'Back Squat' | 'Front Squat' | 'Barbell Shrug';
- class SquatRack {
- configureExercise(exercise: AllowedLifts) {
- console.log(`Squat Rack configured for ${exercise}. Lift on, brotein shake.`)
- }
- }
- const mySquatRack = new SquatRack();
- mySquatRack.configureExercise("Bicep Curl");
- // Argument of type '"Bicep Curl"' is not assignable to parameter of type 'AllowedLifts'.
- mySquatRack.configureExercise("Front Squat");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement