在 underscore 源代码中,如果对一个数组应用 shift 或 splice,并且数组长度为零:
if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
你知道为什么还需要执行这个操作吗:delete obj[0]