title: Do volatile (time-bound) variables exist?
body: <p><strong>I would like to use a variable which, some time after it was last modified, is discarded (or nullified). Does such a thing exist?</strong></p>
  <p>My usage scenario is the following: a websocket server will be pushing updates to a Vue.js <code>vm</code> (a variable, basically) which will trigger a change in the DOM. I would like this change to be reversed (the updated element hidden) some time after the last modification.</p>
  <p>The planned implementation gravitates around a <a href="https://v2.vuejs.org/v2/api/#watch" rel="nofollow noreferrer"><code>watch</code></a> which will update a flag on the change of the <code>vm</code> variable above, checked periodically via <code>setInterval</code> which will in turn modify the <code>vm</code> to trigger the hiding once the flag reaches a certain time.</p>
  <p>While doable, it does not sound very clever to me.</p>
  <p>If there was a way to &quot;fade out&quot; a variable to <code>null</code>, it would be straightforward to trigger the DOM element visibility status.</p>
  <p>Is there such a mechanism?</p>