The JavaScript Testbed is a simple webpage that illustrates the power of the JavaScript Function object type. Simply enter JavaScript code into the Code textbox and click the Run button to see the result. The entire testbed is written in JavaScript and is only 19 lines of code!

Commands

The following special commands are defined in the testbed:

print(x);
Appends the text given by x on the current line.
println(x);
Appends the text given by x on the current line followed by a newline. Equivalent to print(x + "<br>");
attach(x);
Attaches the given HTML element to the Results section. Here is an example:

var div = document.createElement("div");
div.style.fontFamily = "arial";
div.style.fontWeight = "bold";
var txt = document.createTextNode("Hi there!");
div.appendChild(txt);
attach(div);

Running the above code results in this in the Results section:

Hi there!

Hosted by www.Geocities.ws

1