diff --git a/1-js/02-first-steps/09-comparison/article.md b/1-js/02-first-steps/09-comparison/article.md index d889b132..0f9635a5 100644 --- a/1-js/02-first-steps/09-comparison/article.md +++ b/1-js/02-first-steps/09-comparison/article.md @@ -1,15 +1,19 @@ # Comparisons -We know many comparison operators from maths: +We know many comparison operators from maths. + +In JavaScript they are written like this: - Greater/less than: a > b, a < b. - Greater/less than or equals: a >= b, a <= b. -- Equals: `a == b` (please note the double equals sign `=`. A single symbol `a = b` would mean an assignment). -- Not equals. In maths the notation is , but in JavaScript it's written as an assignment with an exclamation sign before it: a != b. +- Equals: `a == b`, please note the double equality sign `=` means the equality test, while a single one `a = b` means an assignment. +- Not equals. In maths the notation is , but in JavaScript the it's written as a != b. + +In this article we'll learn more about different types of comparisons, how JavaScript makes them, including important peculiarities. ## Boolean is the result -Like all other operators, a comparison returns a value. In this case, the value is a boolean. +All comparison operators return a boolean value: - `true` -- means "yes", "correct" or "the truth". - `false` -- means "no", "wrong" or "not the truth".