John Patrick Given

Ruby, Rails, Javascript, Basketball, & Randomness

Javascript Riddle

So I haven't posted on my blog in quite a while which is unfortunate because I feel that writing about programming helps one become a better programmer.  Plus, with practice, perhaps someday I'll actually be able to explain what I do to my mother.

So I thought it would be fun to write a quick post about a JS riddle I thought about yesterday.

It's quick and it's kind of fun.  Here's the riddle:

Without using global variables, write a script that prints the numbers 0 though 100 to the browser, printing each number one second apart.  Remember, no global variables...

Simple, right?

Try it first, but If you want the answer to the riddle you can see it on this Gist over at Github.

Comments (0)

Leave a comment...

The Fine Print

Hi there. My name is J.P. and I write web based software for a living. My real web site is located here. I tweet about stuff here. I scrobble music occassionally here.

This is my Posterous. I'm a terrible writer. Don't judge me.