[Solved] Why my function incrementing plus 2?


You are incrementing i at two places.

Inside for loop

for (i = 1; i <= 16; i++)

and

$tile.length + i++

Because of this it is incrementing two times

solved Why my function incrementing plus 2?