Implement clearAllTimeout()
let timeoutArray = []
let customTimeout = window.setTimeout()
window.setTimeout = (fn, delay) => {
const id = customTimeout(fn, delay)
timeoutArray.push(id)
return id
}
function clearAllTimeout() {
while(timeoutArray.length)
clearTimeout(timeoutArray.pop())
}