When embedded in a browser, the language is invoked according to an event model and the browser itself is the main() for the interpreter. Various script based functions are called by the browser.
In a server side environment, a script may be used as the result of a CGI call. In that case, a main() with passed parameters is a more useful facility.
The result of calling the main() function will be implementation specific, but probably an integer.