functiongetHairType(today){switch(today.toLowerCase()){case"monday":return'bangs';case"tuesday":return'braids';case"wednesday":return'short hair';case"thursday":return'long hair';case"friday":return'bright pink hair';default://default value or throw "only workdays allowed for 'today'"}}
or to allow rapid visualisation of constants:
constMONDAY_HAIRTYPE='bangs';// ... const for each dayconstDEFAULT_HAIRTYPE=MONDAY_HAIRTYPE;letdayHairType=today.toUpperCase()+"_HAIRTYPE";hair=dayHairTypeinthis?this[dayHairType]:DEFAULT_HAIRTYPE;
no undefined, no function call cost
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
or to allow rapid visualisation of constants:
no undefined, no function call cost