Hubbry Logo
search
logo
1862551

JavaScript syntax

logo
Community Hub0 Subscribers
Write something...
Be the first to start a discussion here.
Be the first to start a discussion here.
See all
JavaScript syntax

The syntax of JavaScript is the set of rules that define a correctly structured JavaScript program.

The examples below make use of the console.log() function present in most browsers for standard text output.

The JavaScript standard library lacks an official standard text output function (with the exception of document.write). Given that JavaScript is mainly used for client-side scripting within modern web browsers, and that almost all Web browsers provide the alert function, alert can also be used, but is not commonly used.

TypeScript, which extends JavaScript with type annotations and additional features, has the same syntax as well as its own additional features.

Brendan Eich summarized the ancestry of the syntax in the first paragraph of the JavaScript 1.1 specification as follows:

JavaScript borrows most of its syntax from Java, but also inherits from Awk and Perl, with some indirect influence from Self in its object prototype system.

JavaScript syntax is mostly derived from Java syntax, which in turn is derived from C syntax and C++ syntax.

The following words are keywords and cannot be used as identifiers under any circumstances.

See all
User Avatar
No comments yet.