$shift migration
Removes an item from the beginning of an iterable structure
Signature
path (String/Array) - The path to the iterable
subject (Object) - The object that contains the iterable
TYPE SIGNATURES
String -> Object -> Object
(String, Object) -> Object
Array -> Object -> Object
(Array, Object) -> Object
EXAMPLE
const myObject = {
itemsInTheFrige: ['eggs', 'beer', 'milk']
};
$shift('itemsInTheFrige', myObject);
// returns {
// itemsInTheFrige: ['beer', 'milk']
// }
IMMUTABLE JS SUPPORT
the following types are supported for values targeted by path
:
List
Stack