Skip to main content
cngx-src documentation

arrayEqual

Functionutils

projects/utils/equality.ts

Description#

Shallow positional equality for two readonly arrays. Returns true when both arrays reference the same object, or when they have the same length and every index holds a Object.is-equal value.

Intended as an equal arg for computed() / linkedSignal returning readonly T[], so consumers downstream do not re-render when the computed re-runs but produces a positionally-identical array. Two arrays with the same values in a different order compare unequal.

Signature#

arrayEqual(a, b)

Parameters#

@parama
@paramb

Returns#

boolean