Day 2/100
Today I covered control flows in javascript. Here I'm referring to if statements, if ... else, while loops, etc.
To consolidate the lessons, I solved simple exercises but most notable is the fizzBuzz and Demerit points exercise.
fizzBuzz is a function that accepts an input and if its a number divisible by 3 it returns Fizz, divisible by 5 it returns Buzz, divisible by 3 and 5 it returns FizzBuzz, not divisible by 3 or 5 it returns th number. Finally if the input is not a number, it returns "Not a number".
Demerit points acts as a speed detector. The function accepts the input as speed. If it's less than or equal to 70, you're safe. If it's above 70, you get a point for each 5 above 70. Finally you get your license suspended once you are 12 points and above.
PS: That's day 2 covered. For those of us that may find these difficult or confusing, let me now your thoughts in the comment sections. See you tomorrrow.