docs: function extract (query) {
    var toSplice = []
    var extracted = []
    return function (prev, curr, index, array) {
      if (prev !== extracted) {
        if (testValue(prev, query)) {
          extracted.push(prev)
          toSplice.push(index - 1)
        }
      }
  
      if (testValue(curr, query)) {
        extracted.push(curr)
        toSplice.push(index)
      }
  
      if (index === array.length - 1) {
        toSplice.reverse()
        for (var i = 0; i < toSplice.length; i++) {
          array.splice(toSplice[i], 1)
        }
      }
      return extracted
    }
  }