You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Use lowercase or capitals, don't use mixed cases. This makes it easier to build the key.constPlan=Object.freeze({PAID: 'PAID',DEFAULT: 'DEFAULT',DISCOUNTED: 'DISCOUNTED'})constPlans={[Plan.DEFAULT]: ()=>console.log('default plan'),[Plan.PAID]: ()=>console.log('paid plan'),[Plan.DISCOUNTED]: ()=>console.log('discounted')}constPlanStrategy=(plan)=>{returnPlans[plan]||Plans.DEFAULT}conststrategy=PlanStrategy(Plan.PAID)strategy()// paid plan