MCPcopy Create free account
hub / github.com/breck7/scroll / invertKeyValues

Function invertKeyValues

external/.datatables.js:17241–17247  ·  view source on GitHub ↗

* Switch the key value pairing of an index array to be value key (i.e. the old value is now the * key). For example consider [ 2, 0, 1 ] this would be returned as [ 1, 2, 0 ]. * * @param array arr Array to switch around

(arr)

Source from the content-addressed store, hash-verified

17239 * @param array arr Array to switch around
17240 */
17241 function invertKeyValues(arr) {
17242 var result = []
17243 for (var i = 0; i < arr.length; i++) {
17244 result[arr[i]] = i
17245 }
17246 return result
17247 }
17248 /**
17249 * Move one or more columns from one index to another.
17250 *

Callers 3

finaliseFunction · 0.85
moveFunction · 0.85
setOrderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected