Update Js Roadmap Strict Equality Operator === (#6220)
* Update Js Roadmap Strict Equality Operator === Update @lJwcc6JoUIQoiQ6FkV2KW.md * Update src/data/roadmaps/javascript/content/@lJwcc6JoUIQoiQ6FkV2KW.md --------- Co-authored-by: dsh <daniel.s.holdsworth@gmail.com>feat/ratings
parent
8bc81b6381
commit
0f276bf03a
1 changed files with 14 additions and 1 deletions
@ -1 +1,14 @@ |
|||||||
# === |
# Strict Equality Operator (===) |
||||||
|
In JavaScript, the strict equality operator `===` compares both the value and the type of two operands. This means that it will only return true if both the value and the type are identical. |
||||||
|
```sh |
||||||
|
"5" === "5" // true |
||||||
|
``` |
||||||
|
In this case, both the value and the type are the same, so the result is true. |
||||||
|
```sh |
||||||
|
"5" === 5 // false |
||||||
|
``` |
||||||
|
Here, although the values might appear similar, the types are different (string and number), so the result is false. The strict equality operator does not perform type coercion; both the value and the type must be identical. |
||||||
|
|
||||||
|
Learn more from the following resources: |
||||||
|
|
||||||
|
- [@article@Strict equality - MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) |
||||||
|
Loading…
Reference in new issue