Deck.prototype.getSorted >= 0.1.2
Purpose
Get the sorted values in an array
Syntax
Deck#getSorted
(
Booleanslice= true
);
Parameters
slice
- Slice the array before returning
Return values
Array
Examples
var d = new Deck();
d.push('a', 100);>>> 0
d.push('b', 900);>>> 1
>>> d.push('_', 10);>>> 2
// Sort the values by their weight (higher values come first)
d.getSorted();>>> ["b", "a", "_"]
Comments