inside the loop right?
const appendMultiple = (int, parent, createChild) => {
parent.appendChild(createChild());
if(int){
appendMultiple(--int, parent, createChild);
}
}
appendMultiple(10, parent, () => {
const child = document.createElement('div');
// Decorate the child here
return child;
})
I prefer this actually
Обсуждают сегодня