LIght bulb to light up I'd like to write a JavaScript function that lights up an led light for X milliseconds depending on the response from the JavaScript function.

function HowManySeconds() {
   setTimeout(HowManySeconds,5000)
   return 1000
}


The JavaScript function will come from a website, so I suppose I would need an Internet enabled device that connects to my router and can 'browse' to my website.

Q: What do I need to buy? A tessel? An Espruino?
You could try the intel galileo or the intel edison with arduino shield. They can be programmed with a variant of the arduino ide, but it is possible to call also programs from the native linux os. Or you could have a look at the esp826.
At least on the edison it is possible to run node.js, while the esp supports lua.