Javascript is an ad hoc scripting language developed by Netscape early on (at the advent of the modern web). Originally called ECMA Script, it provides a client-side scripting language which means a developer can embed code into a web page which will be downloaded by visitors to the site and run on their local machines.
Because of the inherant security risks involved with delivering code via a web page, file system operations and any low-level operating system calls are forbidden. So what is Javascript really good for?
Javascript is really useful for controlling custom actions on a web page such as dynamic page animations and developing complex user interface elements on a page. By utilizing action events by elements on the page, the developer can take specific actions when a button is clicked, a text entry changes or the user submits a form. Javascript can do form validation before it is submitted back to the server. It's built-in regular expression support allows you to do complex validation on form fields.
Javascript doesn't have any relationship to the Java Programming language despite the similarities of the two names.
