Day 2 - Understanding Variables and Conditional Statements

ยท

0 min read

FB_IMG_15870446983834889.jpg 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:

Js Code 1_1587579269355.png 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: Js Code 1_1587579306784.png

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. โœจ๐Ÿš€