What is JavaScript? What can be done? An article takes you through the development history, composition and functions of JavaScript

What is JavaScript? What can be done?

8f3ce2c06a4bf6c45103ba1ca66d97f.png

JavaScript (JS for short) is a very popular and widely used scripting language.

JavaScript is one of the three must-learn languages ​​for web developers

The main features of js are:

1. JS is an interpreted scripting language (the code is not pre-compiled);

High-level languages ​​such as C, C++, and Java are compiled first and then executed, while JavaScript is interpreted line by line during the running of the program. During the running process, it is interpreted and executed by the js interpreter (js engine)

image.png

image.png

image.png

Password input errors, email formats, authentication failures... are all explained and executed at runtime (this greatly improves the user experience and network transmission speed)

2. Mainly used to add interactive behaviors to HTML pages;

3. Can be directly embedded into HTML pages

4. Good portability, most browsers support JavaScript

image.png

(Chrome, IE, Firefox, Safari, Edge...) and can run on multiple platforms (such as Windows, Linux, Mac, Android, iOS, etc.).

image.png

JavaScript, along with HTML and CSS, make up the web pages we see, where:

HTML is used to define the content of web pages, such as titles, text, images, etc.;

CSS is used to control the appearance of web pages, such as colors, fonts, backgrounds, etc.;

JavaScript is used to update the content of the web page in real time

JS development history:

JavaScript----is an object-oriented scripting language.

JavaScript was developed by Brendan Eich of Netscape Communications Corporation

Invented in only 10 days (Netscape recruited Brendan Eich in 1995), JavaScript was initially named Mocha , then renamed LiveScript , and later renamed JavaScript due to the intervention of SUN .

In 1996, Microsoft introduced its own implementation of JavaScript, JScript, into its latest IE3 browser.

So there are two versions of JavaScript on the market, Netscape's JavaScript and Microsoft's JScript.

In order to ensure that the JavaScript standards running on different browsers are consistent, several companies jointly customized the standard name of JS and named it ECMAScript.

JavaScript composition:

Usually we use JavaScript and ECMAScript to express the same meaning, but a complete JavaScript consists of the following three different parts.

image.png

  1. Core (ECMAScript)

image.png

2. Document Object Model (DOM)

image.png

3. Browser Object Model (BOM)

image.png

The role of JavaScript:

Form dynamic verification (password strength detection) (original purpose of JS generation)

Web special effects

Desktop program (Electron)

Server-side development (Node.js)

App(Cordova)

Control Hardware-Internet of Things (Ruff)

Game development (cocos2d-js)

We are familiar with WeChat applets, plug-in extensions, game special effects, boosting page views...many of them can be developed and used using JS

Extension: The relationship between JavaScript and java may not be as close as you think. JavaScript was named JavaScript based on the popularity of java at that time~

The Java language is a product of SUN Microsystems, and JavaScript is a product of Netscape.

One sentence to describe: Java to JavaScript is like the relationship between Lei Feng and Leifeng Pagoda

Keywords in JS:

break、delete、function、return、typeof、case、do、if、switch、var、catch、else、in、this、void、continue、false、instanceof、throw、while、debugger、finally、new、true、const、with、default、for、null、try。

Guess you like

Origin blog.csdn.net/m0_64880608/article/details/122341409