Extends
Methods
-
<generator> compare(i, j [, a] [, b])
-
A method to interruptably compare two elements in the array.
aandbare optional, sinceiandjcan sometimes be used to represent indices that are virtual in the comparsion.Parameters:
Name Type Argument Default Description inumber Index of left-hand element to compare.
jnumber Index of right-hand element to compare.
a* <optional>
this[i] Value of left-hand element to compare.
b* <optional>
this[j] Value of right-hand element to compare.
- Inherited From:
Returns:
result - See
compareFunction- Type
- number
-
delete(key)
-
Parameters:
Name Type Description key* Reference key of scoped variable.
- Inherited From:
- Implements:
Returns:
successful - Is
trueif removed,falseif element does not exist.- Type
- boolean
-
<generator> fill(factory [, length])
-
A method to interruptably populate the array with elements generated from
factory.Parameters:
Name Type Argument Default Description factorymodule:sort/virtual.fillCallback lengthnumber <optional>
this.length - Inherited From:
Throws:
-
factorymust be a function. - Type
- TypeError
-
get(key)
-
Parameters:
Name Type Description key* Reference key of scoped variable.
- Inherited From:
- Implements:
Returns:
value - Scoped variable for the given key or
undefinedif none exists.- Type
- *
-
has(key)
-
Parameters:
Name Type Description key* Reference key of scoped variable.
- Inherited From:
- Implements:
Returns:
exists - Instance contains a scoped variable for the given key.
- Type
- boolean
-
<generator> put(index, value)
-
A method to interruptably put an element in the array.
Parameters:
Name Type Description indexnumber Index to put element
value.value* Value to put in
index.- Inherited From:
-
set(key, value)
-
Parameters:
Name Type Description key* Reference key of scoped variable.
value* Value of scoped variable to set.
- Inherited From:
- Implements:
Returns:
- Type
- this
-
<generator> shuffle()
-
A method to interruptably randomize the order of elements in the array. Uses the Knuth Fisher Yates method.
- Inherited From:
-
slice( [begin] [, end])
-
Shallow copy a portion of an array into a new array object.
Parameters:
Name Type Argument Default Description beginnumber <optional>
0 First index of shallow copy.
endnumber <optional>
this.length Last index of shallow copy, not included.
- Inherited From:
Returns:
- Type
- Array
-
<generator> sort()
-
Abstract method to interruptably sort array of elements.
- Inherited From:
- Overrides:
Throws:
-
Illegal invocation.
- Type
- TypeError
-
<generator> swap(i, j)
-
A method to interruptably swap two elements in the array.
Parameters:
Name Type Description inumber Index of first element to swap.
jnumber Index of second element to swap.
- Inherited From: