for (let a = 0; a < 18; a += 6) {
  for (let b = 0; b < 6; b++) {
    document.write(Number(!(b % 2)));
  }
  
  if (a % 6 == 0) {
    document.write('<br>');
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.