SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. type AllowedLifts = 'Back Squat' | 'Front Squat' | 'Barbell Shrug';
  2.  
  3. class SquatRack {
  4.   configureExercise(exercise: AllowedLifts) {
  5.     console.log(`Squat Rack configured for ${exercise}. Lift on, brotein shake.`)
  6.   }  
  7. }
  8.  
  9. const mySquatRack = new SquatRack();
  10. mySquatRack.configureExercise("Bicep Curl");
  11. // Argument of type '"Bicep Curl"' is not assignable to parameter of type 'AllowedLifts'.
  12.  
  13. mySquatRack.configureExercise("Front Squat");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top