i wrote a chat server that supports javascript as scripting language (via spidermonkey from mozilla). one great thing about javascript is that is provides all things you need in a language, but nothing that goes out of the scope of the language itself.
no functions to access a disk or a keyboard or anything. you can write your own functions and objects (and implement them in c or c++) and let them define the whole environment where your scriptiong language is running in.
in my oppinion javascript is one of the few (if not only) languages that is designed to be a scripting engine for anything you like.