Class HashArrayUtil
Index
Constructors
Methods
Constructors
constructor
Returns HashArrayUtil
Methods
Staticaverage
Iterates deeply over items specified by
keyandindexwith an optionalweightKeyand calculates the average value.Type Parameters
- T extends object
Parameters
Returns number
The average value for the given iteration.
Staticdifference
Staticsample
Staticsum
Iterates deeply over items specified by
keyandindexwith an optionalweightKeyand calculates the sum.Type Parameters
- T extends object
Parameters
Returns number
The sum for the given iteration.
Provides extra examples of how various additional operations can be added on top of HashArray. These operations are not included with HashArray to keep it lean and mean for TrieSearch. By all means though extend HashArray and add the operations that you need.
There are tests for all operations below in
./test/hash/HAExtra.test.ts.