JavaScript Fundamentals

JavaScript is an interpreted, object-based scripting language.

The JavaScript language uses a syntax similar to that of C, and supports structured constructs, such as if...else, for, and do...while. Braces ({}) are used to delimit statement blocks. The language supports various data types, including String, Number, Boolean, Object, and Array. It includes support for enhanced date features, trigonometric functions, and regular expressions.

JavaScript uses prototypes instead of classes. You can define an object by creating a constructor function.

JavaScript is a loosely typed language, which means you do not declare the data types of variables explicitly. In many cases JavaScript performs conversions automatically when they are needed. For example, if you add a number to an item that consists of text (a string), the number is converted to text.

In This Section

Writing JavaScript Code
Explains the organization of elements within JavaScript code.

JavaScript Variables
Explains the concept of variables in JavaScript.

Data Types
Enumerates data types in JavaScript and explains the purpose of each type.

Provides a list of operators with links to information about each operator.

Operator Precedence
Explains the rules that control the order in which operations are performed when an expression is evaluated.

Controlling Program Flow
Explains conditional statements and loops in JavaScript.

Describes the built-in functions and explains how to create new functions.

Explains the concept of objects in JavaScript.

Intrinsic Objects
Lists the objects that are part of JavaScript by default and explains the purpose of each object.

Creating Your Own Objects
Explains how to create an object by defining a constructor function.

Date and Time Calculations
Describes how to perform common calendar and clock tasks, such as manipulating and comparing dates, and calculating elapsed time.

Date and Time Strings
Explains how to format date and time strings.

Displaying Text in a Web Page
Describes different ways of displaying text.

Advanced JavaScript
Explains advanced JavaScript functionality, such as recursion, arrays, troubleshooting, and so on.

JavaScript Language Reference
Describes the elements that make up the JavaScript language.