let fadeOut = (elem, cycles = 4, time = 100) => {
// 1 seconds equals 1000 milliseconds
// Assume opacity starts at 1
for(let i = 0; i < cycles; i++) {
setTimeout(() => {
// TODO: your going to adjust the opacity
elem.style.opacity -= .05/cycles
// elem.style.opacity -= 1/cycles
}, time);
}
}
Have any questions or comments? Write them below!