Lodash_what are the roles of index and arr in dropWhile()? example needed

The provided solution by codecademy is below. In the dropWhile method, what are the roles of index and arr in predicate? ? I tried testing with a simple cb with only element as 1 parameter but it was wrong. I guess it would be easier to understand with an example with element, index and arr as arguments of predicate.
Really appreciate any examples to demonstrate how the dropWhile method works. Thanks!

    if (targetDrop === undefined){
      targetDrop = 1
    const droppedArray = arr.slice(targetDrop, arr.length )
    return droppedArray
    const cb = (element,index) => {return !predicate(element,index,arr)}
    let dropNumber = arr.findIndex(cb);
    let droppedArray = this.drop(arr,dropNumber)
    return droppedArray 

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.