- Vanilla JavaScript
This project derived from: Programming Challenges: [Convert to Seconds]
Goal
- Write a function that takes a number of hours and converts it to seconds. Optional: Use the date object to figure out how old you are in seconds.
Stats
-
2017-04-28 -> 5:53pm - 6:54pm = 1 hour
-
- 0.25 hours = 1.25 hours (added the Hours to Seconds conversion)
-
Project status: Successful
-
Project optional: Failed (didn't use a date object)
Overall project took about 1.5 hours to fully complete. Room for improvement.
- Created self-executing closure just to keep it all contained.
- I did have to look up the addEventListener syntax (argument order).
- I found it strange I could not place the console.clear() above the closure.
- Unsure if making the operation functions static and wrapping in a class would be a good approach?
- Once finished, I used Google to double check my results.
- I determined that Google must use 365/12 to account for monthly variations.
- I plugged this assumption into my code and confirmed.