3 Equal Signs? How is it used?

TrenaFritsche
Tera Expert

What do 3 equal signs mean?

showSection = gr.getValue('value') === 'true';

I've seen this a few times and want to understand what it means.  Anyone have a clear understanding on this?

1 ACCEPTED SOLUTION

ScienceSoft
Tera Guru

Hi TrenaFritsche,

=== is a strict comparison operator. For strict equality the objects being compared must have the same type and:

  • Two strings are strictly equal when they have the same sequence of characters, same length, and same characters in corresponding positions.
  • Two numbers are strictly equal when they are numerically equal (have the same number value). NaN is not equal to anything, including NaN. Positive and negative zeros are equal to one another.
  • Two Boolean operands are strictly equal if both are true or both are false.
  • Two objects are strictly equal if they refer to the same Object.
  • Null and Undefined types are == (but not ===). [I.e. (Null==Undefined) is true but (Null===Undefined) is false]

The link below provides more examples:

JavaScript — Double Equals vs. Triple Equals

View solution in original post

2 REPLIES 2

Ashutosh Munot1
Kilo Patron
Kilo Patron

HI,


It is used to check if the value in value field has same data type.


We use === to compare data type of to varaibles.


Thanks,
Ashutosh

ScienceSoft
Tera Guru

Hi TrenaFritsche,

=== is a strict comparison operator. For strict equality the objects being compared must have the same type and:

  • Two strings are strictly equal when they have the same sequence of characters, same length, and same characters in corresponding positions.
  • Two numbers are strictly equal when they are numerically equal (have the same number value). NaN is not equal to anything, including NaN. Positive and negative zeros are equal to one another.
  • Two Boolean operands are strictly equal if both are true or both are false.
  • Two objects are strictly equal if they refer to the same Object.
  • Null and Undefined types are == (but not ===). [I.e. (Null==Undefined) is true but (Null===Undefined) is false]

The link below provides more examples:

JavaScript — Double Equals vs. Triple Equals