GBB Logo         
GBB Services
GBB Services : Resources : Programming : Javascript Lab

Note: (written November 6 2016) I'm glad you found this essay I wrote long ago. It's archived here on my website, together with my other essays from a decade ago. If you want to see my more recent content, my blog is the place to find it.

Javascript Laboratory

INPUT

OUTPUT


Introduction

This is a simple javascript evaluator. You might want to turn on javascript for this page.

Things To Try

Here's some inputs to experiment with. To get one of them into the "Input" box, you can cut and paste it into the "input" text area, or you can just click on it. Press the "Process Input" button, to see the result in the "output" text area.

3*5
(1+4)*(1+9)
Math.pow(2,32)
resizeTo(800,580)
alert("hello world")
1+
2+
3
"pi is roughly " + Math.PI
"e is roughly " + Math.exp(1)
"the golden ratio is roughly " + 0.5*(1+Math.sqrt(5))
evenNumbers=""; first=1; last=50;
for(i=first;i<=last;++i)
{
   val = 2*i;
   evenNumbers += val + " ";
}
evenNumbers;
"the current time is " + Date()
location.href="http://www.gbbservices.com/"
document.bgColor="#FFFF00"
function factorial(n)
{
   retVal=1;
   for(i=1;i<=n;++i)
      retVal *= i;
   return retVal;
}
factorial(5);

Feedback

If you have corrections, additions, modifications, etc please let me know mailto:walterv@gbbservices.com

Back to top of page