Javascript for Smart People

Lexical Structure

Javascript is an interpreted programming language used for creating dynamic web pages. It is embedded in the most popular web browsers where client side scripts can interact with users, and dynamically update content in the browser window. It is a simple to use programming language, but that doesn't mean that you should dive right in and start writing programs. First things should come first and the first thing to know about Javascript to know is how to write programs with it.

The lexical structure of a programming language is its most fundamental rules. These rules tell you how to comment your program, and what character to use to separate simple statements from each other, and more. The lexical structure of a programming language is its most basic syntax. In this article I am going to outline the lexical structure of Javascript.

Lexical Structure includes:

"The lexical structure of a programming language is its most fundamental rules."

Now that we have covered the lexical structure of Javascript we can use what we know to write our first program:

// A comment

/* Another comment */

<!-- Another comment

// An empty statement terminated with a semicolon

;

// A numeric literal, a string literal, and a boolean literal

0;

'Hello world! This is a string literal';

true;

// An identifier

var myVariable;

// A keyword

false;