let sort = [12,6,3,88,1,4,8]; for(let i = 0; i=0){ sort[j+1]=sort[j]; j--; } sort[j+1]=key; } console.log(sort)