namespace CarWashStrategyRevisited { class Car { } type WashingStrategy = ( car : Car ) => void ; function standardWash ( car ) { } function premiumWash ( car ) { } class CarWash { service ( car , premium ) { let washingStrategy ; if ( premium ) { washingStrategy = premiumWash ; } else { washingStrategy = standardWash ; } washingStrategy ( car ) ; } } }