From Wikibooks, open books for an open world
Jump to navigation Jump to search
  Index Next: Relation to other languages

JavaScript is an interpreted computer programming language formalized in the ECMAScript language standard. JavaScript engines interpret and execute JavaScript. JavaScript engines may be designed for use as standalone interpreters, embedding in applications, or both. The first JavaScript engine was created by Netscape for embedding in their Web browser. V8 is a JavaScript engine created for use in Google Chrome and may also be used as a standalone interpreter. Adobe Flash uses a JavaScript engine called ActionScript for development of Flash programs.

Relation to Java[edit | edit source]

JavaScript has no relation to Java aside from having a C-like syntax. Netscape developed JavaScript, and Sun Microsystems developed Java. The rest of this section assumes a background in programming. You may skip to the next section, if you like.

Variables have a static type (integer or string for example) that remains the same during the lifespan of a running program in Java, and have a dynamic type (Number or String for example) that can change during the lifespan of a running program in JavaScript. Variables must be declared prior to use in Java, and have a undefined value when referred to prior to assignment in JavaScript.

JavaScript engines may implement functionality beyond the ECMAScript language standard, such as the required functionality provided by V8, or the Document Object Model found in many Web browsers.

Java includes classes and object instances, and JavaScript uses prototypes.

About this book[edit | edit source]

This book is written as a tutorial, in the sense that all key concepts are explained. As such, it also contains exercises that are clearly marked as such at the end of a page or chapter. Answers for these exercises are also included.

The book can also be used as a reference. For this purpose, all keywords are mentioned and described.

Audience[edit | edit source]

This book assumes you have good knowledge and some experience in the use of computers, Web browsers, text editors, and software development environments. As you will not learn about HTML, CSS, Java, or website design in this book, consult an appropriate book to learn about these subjects.

  Index Next: Relation to other languages