Scala List dropWhile() method with example
The dropWhile() method is utilized to drops the longest prefix of elements that satisfies the stated condition.
Method Definition: def dropWhile(p: (A) => Boolean): List[A]
Return Type: It returns all the elements of the list except the dropped ones.
List(5, 4, 2)