Operator

# Is

<div class="rst-class">

forsearch

</div>

Operator

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Compares two object references to determine whether they both refer to the same object.

## Usage

``` xojo
result = object1 Is object2
```

| Part    | Type                                              | Description                                                         |
|---------|---------------------------------------------------|---------------------------------------------------------------------|
| result  | `Boolean</api/data_types/boolean>`                | Any container expecting a `boolean</api/data_types/boolean>` value. |
| object1 | `Object</api/data_types/additional_types/object>` | Any object name.                                                    |
| object2 | `Object</api/data_types/additional_types/object>` | Another object name.                                                |

## Notes

The <span class="title-ref">Is</span> operator returns `True</api/language/true>` if *object1* and *object2* actually refer to the same object. It checks identity, not contents, so it <span class="title-ref">Is</span> not affected by the presence of a comparison operator. Use it the same way as the `=</api/language/equals>` operator.

## Sample code

In the following example, the <span class="title-ref">Is</span> operator returns `True</api/language/true>`.

``` xojo
Var d1 As New Dictionary
Var d2 As Dictionary

d2 = d1

If d1 Is d2 Then
  ' d1 and d2 are the same reference
Else
  ' d1 and d2 are not the same reference
End If
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`IsA</api/language/operators/comparison/isa>` operator.

</div>
