Instance Methodjavascriptkit 0.24.0JavaScriptKit
makeIterator
JSArray.swift:36func makeIterator() -> Iterator
func makeIterator() -> Iterator
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 Iterator
Iterator type for JSArray
, conforming to IteratorProtocol
from the standard library, which allows easy iteration over elements of JSArray
instances.
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)
static var constructor: JSFunction? { get }
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 }
typealias Element = JSValue