https://github.com/jasheloper/js-calendar
Display number of days in each month.
https://github.com/jasheloper/js-calendar
conditional-statements javascript mdn
Last synced: 3 months ago
JSON representation
Display number of days in each month.
- Host: GitHub
- URL: https://github.com/jasheloper/js-calendar
- Owner: jasheloper
- Created: 2023-10-16T23:51:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-18T01:17:18.000Z (over 1 year ago)
- Last Synced: 2023-10-18T10:31:14.578Z (over 1 year ago)
- Topics: conditional-statements, javascript, mdn
- Language: HTML
- Homepage: https://jasheloper.github.io/js-calendar/
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Demo
https://jasheloper.github.io/js-calendar/## Objective
In this example, you are going to help us finish a simple calendar application.
- MDN Link: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/conditionals#active_learning_a_simple_calendar
## Instructions
- We need you to write a conditional statement inside the `onchange` handler function, just below the `// ADD CONDITIONAL HERE` comment.
- Look at the selected month (stored in the `choice` variable. This will be the `` element value after the value changes, so "January" for example.)
- Set a variable called `days` to be equal to the number of days in the selected month. To do this you'll have to look up the number of days in each month of the year. You can ignore leap years for the purposes of this example.
Hints:
- You are advised to use logical OR to group multiple months together into a single condition; many of them share the same number of days.
- Think about which number of days is the most common, and use that as a default value.