title: Listen to js variable change
body: <p>Let's say there is a code in <strong>place 2</strong></p>
  <pre><code>var place2IsReady = true;
  </code></pre>
  <p>In <strong>place 1</strong> I need to implement the logic below :</p>
  <pre><code>Once place2IsReady value was changed (to true) then display alert('ready!');
  </code></pre>
  <p>Notes:</p>
  <ul>
  <li><em>place2IsReady</em> variable is not available in the scope of <strong>place 1</strong>.</li>
  <li>the code from <strong>place 1</strong> gets executed before <strong>place 2</strong> gets executed (or there is a race condition).</li>
  </ul>
  <p><strong>Solution 1</strong></p>
  <p>I believe I can use window.place2IsReady instead and use setTimeout/setInterval in place 1 until I get <code>window.place2IsReady === true</code>.</p>
  <p>Any better options? Using Listeners? On the variable change?</p>
  <p>P.S. I need to track <strong>only first possible change</strong> of <em>place2IsReady</em>.</p>
  <p>Is there a better way? Thank you.</p>