JavaScript is the game's scripting language of choice. It is object-oriented and has a C-like syntax. While commonly associated with web pages, JavaScript is suitable for embedding in other applications. The game implements JavaScript using Mozilla's C++ based engine, called SpiderMonkey. Performance has drastically improved over time, with the inclusion of advanced JIT (just-in-time) compiling.
For a brief overview of why JavaScript was selected, see this forum post.
For an overview of the language as implemented by SpiderMonkey and for help with programming, see https://developer.mozilla.org/en/JavaScript.