<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
The output is only a black box ("#"). I am desiring output to be a chessboard.
var chessBoard = function (length, black) {
var result = “”;
for (var line = 1; line <= length; line++) {
for (var pair = 1; pair <= length; pair++) {
result += " " + black;
}
result += “
”;
for (var pair2 = 1; pair2 <= length; pair2++) {
result += black + " ";
}
result += “
”;
}
console.log(result);
return result;
}
document.getElementById(“testid”).innerHTML = chessBoard(4, “#”);
---------------------------------------HTML CODE---------------------------------------------
<!doctype html>
<div id="testid">Hello, here will be the pattern!</div>
<script src="Script1.js" type="text/javascript"></script>
------------------------------------------------------------------------------------------------
<do not remove the three backticks above>