Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
New JS Question
  • Loading branch information
tsbugbee committed Apr 5, 2020
1 parent 2f389b5 commit 40802b5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 04 - JS/difference-between-==-and-===-in-JS - Copy.md
@@ -0,0 +1,12 @@
== is used to check for relative equality, whereas === is used to check for strict equality.

In other words, the string '2' will evalutae to true when compared to the integer data type for 2 for equality.

=== will check to see if the contents AND data type are the same, so since a string and an integer aren't the same, it would
evaluate to false.

TLDR:

'2' == 2 will evaluate to True, since the contents are the same

'2' === 2 will evaluate to False, since the data types are different.
@@ -0,0 +1,5 @@
A while loop will only begin to execute if the conditional statement in the while statement is true.

A do while loop will always execute its contents at least once, regardless of whether the conditional statement is true.

In other words, a while loop checks the conditional statement at the beginning of the loop, while a do while loop will check the statement at the end.

0 comments on commit 40802b5

Please sign in to comment.