The callback for filter is given three arguments, the current element, the index, and the original array.
The code you provided creates an array with unique documentNumber properties, as for each element, it looks for the index of the first element that has the same documentNumber as it; if the index of the found element is the same as the current index, then this element is the first occurrence of that property in the array and only then will the callback return true which retains the element. It will remove duplicates.
See also: Array#findIndex
lodashanyway, you might consider rewriting this as_.cloneDeep(_.uniqBy(doc => doc.documentNumber)).