Similar to Array.shift but for objects.