# `angular.equals` (API in module `ng` )

Improve this doc

## Description

Determines if two objects or two values are equivalent. Supports value types, arrays and objects.

Two objects or values are considered equivalent if at least one of the following is true:

- Both objects or values pass `===` comparison.
- Both objects or values are of the same type and all of their properties pass `===` comparison.
- Both values are NaN. (In JavasScript, NaN == NaN => false. But we consider two NaN as equal)

During a property comparison, properties of `function` type and properties with names that begin with `$` are ignored.

Scope and DOMWindow objects are being compared only be identify (`===`).

## Usage

    angular.equals(o1, o2);

### Parameters

- `o1 – {*} –`

  Object or value to compare.

- `o2 – {*} –`

  Object or value to compare.

### Returns

`{boolean}` –

True if arguments are equal.