elementUtils = function(options) {
    var getState = options.stateHandler.getState;

    /**
     * Tells if the element has been made detectable and ready to be listened for resize events.
     * @public
     * @param {element} The element to check.
     * @returns {boolean} True or false depending on if the element is detectable or not.
     */
    function isDetectable(element) {
      var state = getState(element);
      return state && !!state.isDetectable;
    }

    /**
     * Marks the element that it has been made detectable and ready to be listened for resize events.
     * @public
     * @param {element} The element to mark.
     */
    function markAsDetectable(element) {
      getState(element).isDetectable = true;
    }

    /**
     * Tells if the element is busy or not.
     * @public
     * @param {element} The element to check.
     * @returns {boolean} True or false depending on if the element is busy or not.
     */
    function isBusy(element) {
      return !!getState(element).busy;
    }

    /**
     * Marks the object is busy and should not be made detectable.
     * @public
     * @param {element} element The element to mark.
     * @param {boolean} busy If the element is busy or not.
     */
    function markBusy(element, busy) {
      getState(element).busy = !!busy;
    }

    return {
      isDetectable: isDetectable,
      markAsDetectable: markAsDetectable,
      isBusy: isBusy,
      markBusy: markBusy,
    };
  }
Loops through the collection and calls the callback for each element. if the callback returns truthy, the loop is broken and returns the same value.
@public
@param {*} collection The collection to loop through. Needs to have a length property set and have indices set from 0 to length - 1.
@param {function} callback The callback to be called for each element. The element will be given as a parameter to the callback. If this callback returns truthy, the loop is broken and the same value is returned.
@returns {*} The value that a callback has returned (if truthy). Otherwise nothing.