Ruby | Array shift() function
Array#shift() : shift() is a Array class method which removes the first element of self and returns it or nil if the array is empty. Syntax: Array.shift() Parameter: Array Return: removes the first element of self and returns it or nil if the array is empty. Example #1 : # Ruby code for shift() meth