The JavaScript Guide shows you how to use JavaScript and gives an overview of the language. If you need exhaustive information about a language feature, have a look at the JavaScript reference.
readyState should be used sparingly; L10n.ready() and L10n.once() are usually better suited for controlling when code is run relative to the state of the localization.