![Thirty Days Of JavaScript](../images/banners/day_1_3.png)
![Thirty Days Of JavaScript](../images/banners/day_1_3.png)
- [📔 Day 3](#%f0%9f%93%94-day-3)
- [📔 Day 3](#-day-3)
- [Booleans](#booleans)
- [Booleans](#booleans)
- [Truthy values](#truthy-values)
- [Truthy values](#truthy-values)
- [Falsy values](#falsy-values)
- [Falsy values](#falsy-values)
@ -46,7 +46,7 @@
- [Getting minutes](#getting-minutes)
- [Getting minutes](#getting-minutes)
- [Getting seconds](#getting-seconds)
- [Getting seconds](#getting-seconds)
- [Getting time](#getting-time)
- [Getting time](#getting-time)
- [💻 Day 3: Exercises](#%f0%9f%92%bb-day-3-exercises)
- [💻 Day 3: Exercises](#-day-3-exercises)
- [Exercises: Level 1](#exercises-level-1)
- [Exercises: Level 1](#exercises-level-1)
- [Exercises: Level 2](#exercises-level-2)
- [Exercises: Level 2](#exercises-level-2)
- [Exercises: Level 3](#exercises-level-3)
- [Exercises: Level 3](#exercises-level-3)
@ -86,11 +86,11 @@ We agreed that boolean values are either true or false.
- the boolean false
- the boolean false
- '', "", ``, empty string
- '', "", ``, empty string
It is good to remember those truthy values and falsy values. In later section, we will use them with conditions to make decision.
It is good to remember those truthy values and falsy values. In later section, we will use them with conditions to make decisions.
## Undefined
## Undefined
If we declare a variable and if we do not assign a value, the value will be undefined. In addition to this, if a function is not returning the value will be undefined.
If we declare a variable and if we do not assign a value, the value will be undefined. In addition to this, if a function is not returning the value, it will be undefined.
Try to understand the above comparisons with some logic. Remember without any logic might be difficult.
Try to understand the above comparisons with some logic. Remembering without any logic might be difficult.
JavaScript is some how a wired kind of programming language. JavaScript code run and give you a result but unless you are good at it may not be the desired result.
JavaScript is some how a wired kind of programming language. JavaScript code run and give you a result but unless you are good at it may not be the desired result.
As rule of thumb, if a value is not true with == it will not be equal with ===. Using === is safer than using ==. The following [link](https://dorey.github.io/JavaScript-Equality-Table/) has an exhaustive list of comparison of data types.
As rule of thumb, if a value is not true with == it will not be equal with ===. Using === is safer than using ==. The following [link](https://dorey.github.io/JavaScript-Equality-Table/) has an exhaustive list of comparison of data types.
@ -224,18 +226,18 @@ As rule of thumb, if a value is not true with == it will not be equal with ===.
The following symbols are the common logical operators:
The following symbols are the common logical operators:
&&(ampersand) , ||(pipe) and !(negation).
&&(ampersand) , ||(pipe) and !(negation).
&& gets true only if the two operands are true.
The && operator gets true only if the two operands are true.
|| gets true either of the operand is true.
The || operator gets true either of the operand is true.
! negates true to false, false to true.
The ! operator negates true to false and false to true.
1. Create a human readable time format using the Date time object
1. Create a human readable time format using the Date time object
1. YYY-MM-DD HH:mm
1. YYYY-MM-DD HH:mm
2. DD-MM-YYYY HH:mm
2. DD-MM-YYYY HH:mm
3. DD/MM/YYY HH:mm
3. DD/MM/YYYY HH:mm
### Exercises: Level 3
### Exercises: Level 3
1. Create a human readable time format using the Date time object. The hour and the minute should be all time two digits(7 hours should be 07 and 5 minutes should be 05 )
1. Create a human readable time format using the Date time object. The hour and the minute should be all the time two digits(7 hours should be 07 and 5 minutes should be 05 )