Ruby | Array class drop_while() operation
Array#drop_while() : drop_while() is a Array class method which drops elements from the array following the specific condition.
Syntax: Array.drop_while() Parameter: block - condition to follow Return: array after removing the elements based on the condition
Code #1 : Example for drop_while() method
drop : [18, 22, 33, 100] drop : [4, 88, 9]
Code #2 : Example for drop_while() method
drop : ["dog"] drop : [nil, "dog"]