JSFiddle - React, Tailwind, and code Playground

by JCatJ098d9837

JavaScript

var words = new Array();

		//words array key and value pairs: key is #; value is word
		words[0] = "Extemporaneous";
		words[1] = "Voracious";
		words[2] = "Capricious";
		words[3] = "Squander";
		words[4] = "Prattle";
		words[5] = "Equivocate";
		
		document.write("<h5>Here’s the original list of words:</h5>");
		
		for(var i in words)
		{
			document.write(words[i] + "<br/>"); 
		}

		var userWord = prompt("Please add one word to our word list!");
		
		words.push(userWord + " <-- This is your word.");
		
		document.write("<br/>" + "<h5>Here’s the new list, with your word added:</h5>");
		
		for(var i in words)
		{
			document.write(words[i] + "<br/>");
		}