JavaScript === (Triple Equals)

Leave a comment

The triple equals sign in JavaScript means “equality without type coersion”. That means, the type and values must both be equal.

Take for example the scenario where 0 is false.

If we compare with 2 equal signs, the following statement is true. This is because the equality operator converts if they are not of the same type:

0 == false // true

If we compare the same 0 and false with ===, we have false returned. As 0 and false are different types, they are not equal in this case. The strict equality operators perform equality comparisons on operands of the same type.

0 === false // false

You can read more about comparison operators at Mozilla: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators. The strict equality operators use the strict equality comparison algorithm.

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

Leave a Reply

Your email address will not be published. Required fields are marked *