title: Is it possible to clear a timeout or stop a timeout from within a set timout?
body: <p>Bascically I have a set timeout and I wanna make it so that if during that timeout something happens I can end it. Here is the code.</p>
  <pre><code>        let QandA = db.get(`QandA`)
          QandA.forEach((element, index) =&gt; {
              async function quiz(message, element){
                  let split = element.split('|')
                  message.channel.send(`**${split[0]}**`)
                  message.channel.awaitMessages(m =&gt; m.content.includes(split[1]), { max: 2, time: 5000 }).then(collected =&gt; {
                      if (collected.first().author.bot) {
                          return
                      }
                      if (collected.first().content === split[1]) {
                          message.channel.send(`Congratulations &lt;@${collected.first().author.id}&gt; You got it right`)
                          var ttttt = true
                          ttt()
                      }
                  })
              }
              var timer = setTimeout(() =&gt; {
                  quiz(message, element)
              }, 5000 * index);
              async function ttt(){
                  if(timer){
                      clearTimeout(timer)
                      console.log('Done')
                  }
              }
          })
  </code></pre>