Skip to content

firstInvalid() function

Returns the first validator entry of a validation result with the isValid property equal to false.

Syntax

firstInvalid(validationResult)

Parameters

Return value

An array with a validatable object as the first element and a validator as the second.

Description

Returns the first validator entry of the passed in validation result that is being in the “invalid” state. When all validators are in the “valid” state, returns an empty array.


Implementation: first-invalid.js.

Examples