This was written during my participation in the #DevCUyo 30DaysofCode. Day 2, The Clock Project: Understanding Variable and Conditional Statements.
This is my first Technical article in a bid understanding JavaScript as a web development language. I learnt that you learn how to code by coding. I also learnt that understanding some chunk of code is necessary to growing as a Developer.
The Project on the article is the project I'm learning parts of the code that forms the whole Clock.
Variables: These are containers that assumes the value of the content.
Basic e.g:
var minutes = 12;
Conditional Statements: The are lines of code that enables the program to make a decision. In JavaScript it has these syntax.
if (minutes = 5) {
Console.log("It's remaining 5 minutes");
}
The Clock Project code will be analyzed in parts to magnify the Javascript concepts it is made up of.
Line 1-6:
Understanding Variables. In the first few lines some of the major Variables that makes up the code were defined. The "wakeuptime", "noon", "lunchtime" etc. In these lines these variables were declared and is to be used on other parts of the code.
Line 7-47:
The next set of lines that bears the conditional statements had inputs to decide the values of the meridian, the number vaule of the hour, minutes and seconds. The other parts of the program are part of Javascript I will be writing about on the 3rd Day Article. โจ๐