Last modified on 22 May 2014, at 03:42

JavaScript/Introduction

Previous: JavaScript Index Next: First Program

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 interpretors, 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 interpretor. Adobe Flash uses a JavaScript engine called ActionScript for development of Flash programs.

Relation to JavaEdit

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) which remains the same during the lifespan of a running program in Java, and have a dynamic type (Number or String for example) which 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.

Java has an extensive collection of libraries which can be imported for use in programs. JavaScript does not provide any means to import libraries or external JavaScript code. JavaScript engines must extend the JavaScript language beyond the ECMAScript language standard, if additional functionality is desired, 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 bookEdit

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.

AudienceEdit

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


Previous: JavaScript Index Next: First Program