Logo

dev-resources.site

for different kinds of informations.

What the f#$k is strict equality.

Published at
4/10/2024
Categories
javascript
beginners
booleans
comparison
Author
behuti
Author
6 person written this
behuti
open
What the f#$k is strict equality.

Sometimes I see some memes regarding Javascript equality and yeah, some of them are pretty funny, here is my favorite.

Image description

I see that there is a common pattern, this "weird" behavior always happens with the double equal sign operator == which we can call loose equality. This happens because it perfoms the IsLooselyEqual algorithm, and the Javascript engine will perform a typer cohertion to try to match both sides in type and value.

How can avoid these "weird" behavior?

Well when you use the triple equal operator === javascript doesn't convert at all the type of your values, and then performs a comparison and checks that both values and types, and if both are for example the same number and the same type, the result of the comparison will be 'true'.

comparison Article's
30 articles in total
Favicon
GraphQL vs REST: When to Choose Which for Your Node.js Backend
Favicon
Automated Test Tools Comparison Table (Updated for 2025)
Favicon
The MinIO alternative for Time-Series Based Data
Favicon
Top Image to HTML Converter Comparison
Favicon
MongoDB vs ReductStore: Choosing the Right Database for Robotics Applications
Favicon
Innovative Background Removal Solutions: A Comparative Analysis of Technologies
Favicon
FalkorDB vs Neo4j
Favicon
Top 10 Prometheus Alternatives in 2024 [Includes Open-Source]
Favicon
cURL vs Postman
Favicon
What Are the Key Differences Between iOS and macOS?
Favicon
Webcare360 vs QloudHost: Deep Dive into Two Leading DMCA Ignored Hosting Providers
Favicon
Comparing DataSpaces and Cloud
Favicon
Comparing Vue.js and React: Front-end Technologies
Favicon
The comparisons with `nan` and `inf` in PyTorch
Favicon
Rust vs. C++: Modern Developers’ Dilemma
Favicon
What the f#$k is strict equality.
Favicon
Python vs JavaScript performance
Favicon
Hasura vs. DreamFactory: A Comprehensive Comparison
Favicon
Top 9 Hasura Alternatives for 2024
Favicon
Frontend VS Backend
Favicon
Feature Flag Services Under $300
Favicon
Decoding the Tech Maze: Demystifying SRE and DevOps for Everyone
Favicon
Navigating the Cloud: OpenShift vs. Kubernetes
Favicon
The Future of Software Development: GitOps vs. DevOps
Favicon
Docker vs Podman
Favicon
Postman Terms vs GitHub Terms
Favicon
React State Management in 2024
Favicon
Before and after image slider in pure CSS
Favicon
TypeScript vs JavaScript - What's the difference?
Favicon
Select the best GUI toolkit – part 7: pyQt

Featured ones: