constructor
JSArray.swift:5static var constructor: JSFunction? { get }
static var constructor: JSFunction? { get }
s13JavaScriptKit7JSArrayC11constructorAA10JSFunctionCSgvpZ
What are these?2V24R
import JavaScriptKit
Swift framework to interact with JavaScript through WebAssembly.
class JSArray
A wrapper around the JavaScript Array
class that exposes its properties in a type-safe and Swifty way.
class JSFunction
JSFunction
represents a function in JavaScript and supports new object instantiation. This type can be callable as a function using callAsFunction
.
convenience init?(_ jsObject: JSObject)
Construct a JSArray
from Array JSObject
. Return nil
if the object is not an Array.
required convenience init?(from value: JSValue)
required init(unsafelyWrapping jsObject: JSObject)
var count: Int { get }
The number of elements in that array not including empty hole. Note that count
syncs with the number that Iterator
can iterate. See also: JSArray.length
var endIndex: Int { get }
let jsObject: JSObject
var length: Int { get }
The number of elements in that array including empty hole. Note that length
respects JavaScript’s Array.prototype.length
var startIndex: Int { get }
subscript(position: Int) -> JSValue { get }
func makeIterator() -> Iterator
class Iterator
Iterator type for JSArray
, conforming to IteratorProtocol
from the standard library, which allows easy iteration over elements of JSArray
instances.
typealias Element = JSValue