Contents

JSValueToNumber(_:_:_:)

Converts a JavaScript value to a number and returns the resulting number.

Declaration

func JSValueToNumber(_ ctx: JSContextRef!, _ value: JSValueRef!, _ exception: UnsafeMutablePointer<JSValueRef?>!) -> Double

Parameters

  • ctx:

    The execution context to use.

  • value:

    The Jsvalueref to convert.

  • exception:

    A pointer to a Jsvalueref to store an exception in, if any. Pass NULL to discard any exception.

Return Value

The numeric result of conversion, or NaN if the system throws an exception.

See Also

Converting to Primitive Values