Skip to main content Link Search Menu Expand Document (external link)

== : Equality Operator


On this page

Summary

Compares two values for equality. Returns true if values are equal, false otherwise.

Syntax



Operands

Position Type Description
Left Any First value to compare
Right Any Second value to compare

Returns

Type: Boolean

true if the operands are equal, false otherwise.


Examples

Basic Comparison

5
<!-- Output: true -->

5
<!-- Output: false -->

String Comparison


  <span class="badge-active">Active</span>

Data:

doc.Params["model"] = new {
    status = "active"
};

Number Comparison


  <span class="out-of-stock">Out of Stock</span>

  <span> in stock</span>

Boolean Comparison


  <span class="premium-badge">Premium Member</span>

Multiple Conditions


  <button>Delete</button>

  <button>Edit</button>

  <button>View</button>

With #each


  
    <div class="electronics-product">
      <h3></h3>
    </div>
  


Precedence

Priority level in expression evaluation: 7 (after comparison operators)


Notes

  • String comparisons are case-sensitive: "Hello" == "hello" is false
  • null == null returns true
  • Comparing null to any non-null value returns false
  • Numbers and strings can be compared (automatic type conversion)
  • Boolean values: true != false

See Also