Instance Method

isInstance(of:)

Returns a Boolean value indicating whether the value is an instance of another JavaScript object value.

Declaration

func isInstance(of value: Any!) -> Bool

Parameters

value

The value to be compared against.

Return Value

true if this value inherits from value; otherwise, false.

Discussion

This method is analogous to the instanceof operator in JavaScript: it tests for the presence of the specified value’s constructor prototype in this value’s prototype chain.

See Also

Comparing JavaScript Values

func isEqual(to: Any!) -> Bool

Compares the value to another for strict equality.

func isEqualWithTypeCoercion(to: Any!) -> Bool

Compares the value to another for equivalence, allowing type conversion.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software