* Returns the index of the object within the given array * @param {Array} arr Array that may or may not hold the object * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find * @return {Number} The index of th
(arr, obj)
| 427 | * @return {Number} The index of the object in the array, or -1 |
| 428 | */ |
| 429 | function indexOfObject(arr, obj) { |
| 430 | for (var i in arr) { |
| 431 | if (!arr.hasOwnProperty(i)) continue; |
| 432 | for (var key in obj) { |
| 433 | if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i); |
| 434 | } |
| 435 | } |
| 436 | return -1; |
| 437 | } |
| 438 | function getParentAutoScrollElement(el, includeSelf) { |
| 439 | // skip to window |
| 440 | if (!el || !el.getBoundingClientRect) return getWindowScrollingElement(); |
no outgoing calls
no test coverage detected
searching dependent graphs…