Home > Web Front-end > JS Tutorial > Summary of basic JavaScript knowledge (1)

Summary of basic JavaScript knowledge (1)

php中世界最好的语言
Release: 2018-03-10 11:31:13
Original
1479 people have browsed it

This time I will bring you a basic knowledge summary of JavaScript. There are a total of eleven knowledge points. This is the first one. The following is a practical case. Let’s take a look.

Write at the front

JavaScript is a scripting language that belongs to the Internet! JavaScript is used by millions of web pages to improve design, validate forms, detect browsers, create cookiess, and much more.

Features of JS language

Interpreted language (does not need to be compiled into a file) Cross-platform

Single-threaded

ECMA annotation-In order to gain technical advantages Microsoft Exit Instead of JScript, CEnvi launched ScriptEase, which can run on the browser as well as JavaScript. In order to unify the specifications, JavaScript is compatible with the ECMA standard, so it also becomes ECMAScript. The process is to compile the program into a machine language file. There is no need to re-translate it when running, just use the compiled result directly. The program execution efficiency is high, it relies on the compiler, and its cross-platform performance is poor. Such as C, C++, Delphi, etc.

Interpreted languages: Interpreted language programs do not need to be compiled before running. They are translated when the program is run. A special interpreter is responsible for interpreting each statement when it is executed. code. In this way, the interpreted language needs to be translated every time it is executed, which is relatively inefficient. For example, JavaScript php

python

, etc.

java is a bit special. It first passes an instruction javac-->compile-->.class file and then passes--->jvm virtual machine- -Explanation and executiongraph TB

A{java file}-->B (via command javac)

B--> C[Compile into .class]

C-- > D[jvm virtual machine]

D--> E[Explanation and execution]


(2) Single thread

A single thread goes when the program is executed The program paths are arranged in consecutive order. The first ones must be processed before the later ones will be executed.

Execution of JS

Queue

Rotation time slice: Time slice rotation scheduling is one of the oldest, simplest, fairest and most widely used algorithms, also known as RR scheduling. Each process is assigned a period of time, called its time slice, which is the time the process is allowed to run. You can say that the JS engine wants to execute task A or task B. It will not execute task A after executing task A and then execute task B. Instead, it will cut task A and task B into milliseconds or microseconds. Fragments in units are arranged in a random manner (this is also called competing for time slices), and then these arranged fragments are sent to the JS engine one by one. In the JS engine, each fragment is used as a basis. The unit executes this fragment, and executes Task A and Task B according to the fragment

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Related reading:


vue life cycle, vue instance, template syntax

About front-end interview (2)

Detailed explanation for newbies learning vue


The above is the detailed content of Summary of basic JavaScript knowledge (1). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template