title: Fast rectangle to rectangle intersection
body: <p>What's a fast way to test if 2 rectangles are intersecting?</p>
  
  <hr>
  
  <p>A search on the internet came up with this one-liner (WOOT!), but I don't understand how to write it in Javascript, it seems to be written in an ancient form of C++.</p>
  
  <pre><code>struct
  {
      LONG    left;
      LONG    top;
      LONG    right;
      LONG    bottom;
  } RECT; 
  
  bool IntersectRect(const RECT * r1, const RECT * r2)
  {
      return ! ( r2-&gt;left &gt; r1-&gt;right
          || r2-&gt;right &lt; r1-&gt;left
          || r2-&gt;top &gt; r1-&gt;bottom
          || r2-&gt;bottom &lt; r1-&gt;top
          );
  }
  </code></pre>