JavaScript - multi-dimesional array from input
<p>Basically, this is the last question from an assignment and I'm seriously at a loss.
I need to create an x by x matrix of alternating 1's and 0's where x is the user input.
An example, if the user inputs 2, the matrix would look as such</p>

<pre>
0 1
1 0
</pre>

<p>If the user inputs 4 the matrix would look as such</p>

<pre>
0 1 0 1
1 0 1 0
0 1 0 1
1 0 1 0
</pre>

<p>etc...
I've scoured stack overflow and other forums, and I understand how to create an array.
It's just the alternating 1 and 0 and how to display it as such.
Thanks to anyone who has any ideas.</p>
