* 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
(arr, obj)
| 433 | * @return {Number} The index of the object in the array, or -1 |
| 434 | */ |
| 435 | function indexOfObject(arr, obj) { |
| 436 | for (var i in arr) { |
| 437 | if (!arr.hasOwnProperty(i)) continue; |
| 438 | for (var key in obj) { |
| 439 | if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i); |
| 440 | } |
| 441 | } |
| 442 | return -1; |
| 443 | } |
| 444 | function getParentAutoScrollElement(el, includeSelf) { |
| 445 | // skip to window |
| 446 | if (!el || !el.getBoundingClientRect) return getWindowScrollingElement(); |
no outgoing calls
no test coverage detected
searching dependent graphs…