Great video! But perhaps a simpler solution might look like this: var moveZeroes = function(nums) { for(let i = 0; i < nums.length; i++){ if(nums[i] === 0){ nums[nums.length - 1] = nums.splice(i,1) } } }; This will only require one loop. If anyone can see any issues with this solution at scale please let me know.