JavaScript Tutorial

JavaScript Beginner Guide

In JavaScript, the textual data is stored as strings. There is no separate type for a single character. Strings can be enclosed within either single quotes, double quotes or backticks.

Numbers in JavaScript are stored in 64-bit format IEEE-754, also known as double precision floating point numbers.

JavaScript objects are variables that can contain many values. The values are written as name:value pairs (name and value separated by a colon). An object can be created with curly brackets with an optional list of properties. A property is a "key: value" pair, where key is a string (property name), and value can be anything.

A JavaScript function is a collection of statements, either named or unnamed (anonymous), that can be called from elsewhere within a JavaScript program. Functions can accept arguments, which are input values passed into the function.

There are three conditional statements in JavaScript - if, if .. else, and switch.

There are three browser-specific functions to interact with visitors: alert, prompt, and confirm. All these methods are modal - they pause script execution and don’t allow the visitor to interact with the rest of the page until the window has been dismissed.

Step by step learning of JavaScript from beginner topics to advance level.

Operators can be used both on literal values, such as the numeral 10, and on variables and other objects in JavaScript.

There are five loops in JavaScript - while, do..while, for, for..in, and for each..in.

The Document Object Model (DOM) provides a way to access and alter the contents of Hypertext Markup Language (HTML) documents. The DOM represents HTML documents in an uprooted tree-like structure because the root of the tree is on top.

JavaScript has been used with web forms for a long time to quickly verify that a user has filled in form fields correctly before sending that form to the server, a process called client-side validation.

jQuery is a popular and easy-to-use JavaScript framework. jQuery makes difficult JavaScript tasks easy, often by taking the pain out of cross-browser JavaScript. The entire jQuery library consists of only a single JavaScript file, which simplifies its inclusion.

In programming terms, a library is a grouping of code that provides common or additional functionality. Libraries consist of one or more files that expose objects and functions. Within a program, a developer includes or calls the library to use these additional objects and functions.

The Browser Object Model creates a tree-like hierarchy of objects, many of which provide properties and methods. The browser itself is represented by one object, called
the window object.

JavaScript can display data in many ways.

HTML events are "things" that happen to HTML elements. When JavaScript is used in HTML pages, JavaScript can "react" on these events. An HTML event can be something the browser does, or something a user does.

JavaScript variables are containers for storing data values. All JavaScript variables must be identified with unique names. These unique names are called identifiers. Identifiers can be short names (like x and y) or more descriptive names (age, sum, totalVolume). JavaScript identifiers are case-sensitive.

JavaScript is the programming language of HTML and the Web. Along with HTML and CSS, JavaScript is one of the three languages used for web development. JavaScript was invented by Brendan Eich in 1995, and became an ECMA standard in 1997. ECMA-262 is the official name of the standard. ECMAScript is the official name of the language.