jQuery jAM, Season 6

Exercise 2.3

Chess Board

	

var x = "#";
var y = "y";
var size = prompt("What size board");
for( var j =0; j < size ; j++){
  x = x + "#";
for(var i =0; i < size; i++){
  if(x.length === size - 1){
    if(i % 2){
    console.log(" "+x);
  } else {
    console.log(x);
  }
}
}
}

	

To open the JavaScript console, press F12 or on MAC press COMMAND-OPTION-I.