title: Convert setInterval to promise
body: <p>Hello I'm new to javascript and wondering if there is a way to covnert below setInterval thingy into a promise so that <code>.then</code> could be used instead of the <code>callback</code>. Any help?</p>
  
  <p>My ideas:<br>
  With a <code>setTimeout</code> I could <code>resolve</code> after a fixed time. But I'm not getting any ideas dealing with <code>setInterval</code>...
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function alert_above(scrip, price, callback) {
    var intvl = setInterval(() =&gt; {
      if (get_last_price(scrip) &gt; price) {
        callback();
        clearInterval(intvl);
      }
    }, 1000);
   return intvl;
  }</code></pre>
  </div>
  </div>
  </p>