Although I never use push personally, and I would not use shift either. Instead I leave the array in a sparse state and reassign keys, or keep a cursor location updated
— Yes more or less
— Shift is slower I believe
— Agreed
— It is not good to change Array size a lot, so having undefined indexes is better
— Huh, makes sense
— Instead I would simply have a cursor increment every traversal, moving down the array as it's value increases