Skip to content

Instantly share code, notes, and snippets.

@wofockham
Last active January 10, 2023 00:52
Show Gist options
  • Save wofockham/64bc0aa2857797dc4e57 to your computer and use it in GitHub Desktop.
Save wofockham/64bc0aa2857797dc4e57 to your computer and use it in GitHub Desktop.

1. Create an array of the days of the week

  • Create a variable named days_of_the_week as an array of the following:
    • Monday
    • Tuesday
    • Wednesday
    • Thursday
    • Friday
    • Saturday
    • Sunday

2. My calendar says the first day is Sunday...

  • Remove Sunday from the last postion and move it to the first position. Use array methods.

3. Create a new array of the days of the week:

  • The first inner array should be the weekdays
  • The second inner array should be the weekend days

4. Remove either the weekdays or the weekends

Your choice...

5. Sort the remaining days alphabetically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment