As already mentioned, document.querySelectorAll("#lista div")
returns a list, type array and you can not get IDs directly, you have to iterate. So you could do with less code the following:
function deletarTudo() {
var lista = document.querySelectorAll("#lista div");
lista.forEach(el => controle("adicionar", el.id));
};
Example:
const controle = (metodo, id) => console.log(metodo, id); // só para o exemplo
function deletarTudo() {
var lista = document.querySelectorAll("#lista div");
lista.forEach(el => controle("adicionar", el.id));
};
deletarTudo();
<div id="lista">
<div id="1">1</div>
<div id="2">2</div>
<div id="3">3</div>
</div>