I am looking for the JavaScript equivalent of Python {dict} .pop (). I see that JS has shift () and pop (), but they are hardcoded for the first and last positions in the array. Is there an equivalent where I can specify a position for an object?
An example of what I can do in Python:
>>> foxx = {'player':{'name':'Jimmie','last':'Foxx','number':3}, 'date':'2018-01-01', 'homeruns':3,'hits':4}
>>> player = foxx.pop('player')
>>> foxx
{'date': '2018-01-01', 'homeruns': 3, 'hits': 4}
>>> player
{'name': 'Jimmie', 'last': 'Foxx', 'number': 3}
source
share