code: function _LayoutCommon_rangeForGroup(group, range) {
                      var first = group.startIndex,
                          last = first + group.count - 1;
  
                      if (!range || range.firstIndex > last || range.lastIndex < first) {
                          // There isn't any overlap between range and the group's indices
                          return null;
                      } else {
                          return {
                              firstIndex: Math.max(0, range.firstIndex - first),
                              lastIndex: Math.min(group.count - 1, range.lastIndex - first)
                          };
                      }
                  }
docs: Empty ranges are represented by null. Non-empty ranges are represented by an object with 2 properties: firstIndex and lastIndex.