weekdayText

    0

    0

    The above code returns a function which can be used to get the text for each weekday.

    function weekdayText(weekdays) {
      return function getText(number) {
        if (number >= 0 && number < weekdays.length) {
          return weekdays[number];
        } else {
          throw new Error('Invalid weekday number');
        }
      }
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.