JSFiddle - React, Tailwind, and code Playground

by jay dowling

HTML

<p>Lets play a Game!</p>
<p>I want you to think of a number from 1 to 10, and I will try to guess it.</p>
    <input></input>
<p><button onclick="fillArray()">Pick Number</button></p>

JavaScript

function fillArray() {
	
	var numArr = new Array (10);
	var i;
		for (i = 0; i < 10; i++)
		{
			numArr[i] = i + 1;
		}
		i = 0;
		while (i < 10)
		{
			document.write ("numArr[" + i + "] = " + numArr[i] + "<br>");;
			i++;
		}
}