
Hosted Project
JavaScript day of the week app
GitHub Source Files
https://github.com/JS-Beginners/day-of-the-week-app
Project Objective
This day of the week project uses JavaScript to create an application that displays the day of the week along with a corresponding quote.
It uses the JavaScript Date object and a switch statement.
JavaScript Used
- Date() Object
- switch statement
My Personalize Summary
This project was another one that didn't take me very long to complete.
The instructor used an array to complete his project, but since I just took notes on JavaScript control flow yesterday, I determined that a switch statement was more appropriate for this project.
The only thing that you may find tricky is converting the day from the Date() object into the day of the week.
It appears that JavaScript doesn't do this automatically, at least not that I've researched hard enough to determine.
So, my switch statement took the computer indexed day of the week from my local computer and assigned a day.
Simple enough.
New Things Learned or Refreshed
Nothing new, but I did have a bug in my code.
Luckily, it only took me a few seconds to figure out.
I forgot my break
statement in a few cases within my switch
statement, which made my code pass through down to my last case
statement.
So, I was getting Saturday even though today is Friday.
Time to Code
This project took me about 20 minutes to complete on my own.
Your Turn!
What To Accomplish
- Download the source code from the github repository above.
- Delete the contents of the
app.js
file. - Implement the JavaScript code in your own
app.js file.
- If you think you need to see a video solution first, be sure to pick up Bluelime's 27 JavaScript Projects Beginner Course .
- Add a link to your finished project below!
What You Should See
Visit the hosted github page to see this JavaScript Day of the Week app in action.
Leave a Reply