Estoy haciendo esto para limpiar la matriz theClouds = [];
function removeClouds(obj){ var index = theClouds.indexOf(obj); if ( index > -1){ theClouds.splice(index, 1); console.log(theClouds.length); } } function deleteClouds(){ for (let u = 0; u < theClouds.length; u++){ theCloud = theClouds[u]; removeClouds(theCloud); } }Pero por alguna razón, el bucle se detiene en el medio, elimina uno o dos y luego ignora el resto, tengo que hacer clic en el botón que activa la función deleteClouds para forzar el bucle y eliminar todo.
Olvidé mencionar, pero theClouds[] es una matriz de matrices, no sé si eso concluye lo mismo, así que theClouds = [ the.cloud = [x,y, image]]
Doing this will have the same point? function deleteClouds(){ theClouds = []; } }