title: How do I see if two rectangles intersect in JavaScript or pseudocode?
body: <p>I have two rectangles which I must return in a function whether they intersect or not.</p>
  
  <p>They are represented by <code>[ x0, y0, x1, y1 ]</code> pairs that represent the top-left and bottom-right corner of the rectangles. Alternatively, your solution could be <code>[ x0, y0, width, height ]</code> if its somehow simpler, I can adapt my function's parameter input by it.</p>
  
  <p>I tried to see if any of the two corners from rectangle A are included in rectangle B but if A is larger than B and B is partially included in A, it will say it doesn't overlap. Now I could try A and B but this seems to be a bad way to do things.</p>
  
  <p>I can't premake a big grid and occupy cells by the rectangles because it is unknown what rectangles come as. All I can tell is that they are unsigned integers, min 0 and with an unknown max.</p>