JavaScript foundation 1 (overview, data types)
JavaScript language foundation
Summary
Brief introduction: Javascript (abbreviated as "JS") is famous as a scripting language for developing Web pages. It is the most popular scripting language in the world, but it is also used in many non browser environments. JavaScript is based on prot ...
Posted by sbourdon on Tue, 04 Feb 2020 08:08:30 -0800
Block level scope in JS, the difference among var, let and const
First, ECMAScript and JavaScript relationships:
ECMAScript is an internationally adopted standardized scripting language. JavaScript is composed of ECMAScript, DOM and BOM. It can be simply understood as: ECMAScript is the language specification of JavaScript, and JavaScript is the implementation and extension of ECMAScript.
...
Posted by adeelzia on Thu, 09 Jan 2020 09:40:43 -0800
What techniques can be used to define classes in JavaScript, and what are their trade-offs?
I like to use OOP in large projects that I'm currently working on. I need to create several classes in JavaScript, but if I remember correctly, there are at least two ways to do this. What is grammar and why is it used in this way?
I want to avoid using third-party libraries - at least in the first place. In search of other answers, I foun ...
Posted by maGGot_H on Tue, 24 Dec 2019 03:54:44 -0800
Basic introduction module of TypeScript (2)
Reprint Basic introduction module of TypeScript (2)
Generate module code
According to the module target specified during compilation, the compiler will generate appropriate code for Node.js (CommonJS), require.js (AMD), UMD, SystemJS or ECMAScript 2015 native module (ES6) module loading system. For more information about the define, require, ...
Posted by coffeehead on Sat, 21 Dec 2019 12:44:41 -0800
JavaScript Syntax Basics - Statements and Expressions
about
This article was started by the WowBar team at GitHubAuthor: yvongyang
Catalog
Expression
Sentence
Expression statement
compare
Reference resources
Statements and Expressions
The main difference between expressions and statements in JavaScript is that a statement executes an action and an expression produces a value.Meaning is that an ...
Posted by veroaero on Sun, 15 Dec 2019 10:27:13 -0800
Solutions to asynchronous programming -- promise and await
What is promise?
Promise, in short, is a container that holds the results of an event (usually an asynchronous operation) that will end in the future. Syntactically, promise is an object from which messages for asynchronous operations can be obtained. Promise provides a unified API, and all kinds of asynchronous operations can be processed in t ...
Posted by colemanm on Wed, 11 Dec 2019 20:03:15 -0800
How to randomize (randomly play) JavaScript arrays?
I have an array like this:
var arr1 = ["a", "b", "c", "d"];
How to play randomly?
#1 building
A person can (or should) use it as an Array prototype:
From ChristopheD:
Array.prototype.shuffle = function() {
var i = this.length, j, temp;
if ( i == 0 ) return this;
while ( --i ) {
j = Math.floor( Math.random() * ( i + 1 ...
Posted by jinwu on Wed, 11 Dec 2019 12:46:31 -0800
Getting started with the Java script engine
Java Script Engine
The Java script engine can embed scripts into Java code, customize and extend Java applications, and since the introduction of JDK1.6, based on the Rhino engine, uses the Nashorn engine after JDK1.8 to support ECMAScript 5, but may change later.
The script engine packages are located in javax.script, and the class names and ...
Posted by gabeg on Mon, 09 Dec 2019 06:27:58 -0800
JavaScript composition and strings
1. Get element method 2
You can use the getElementsByTagName method on the built-in object document to get a certain label on the page. What you get is a selection set, not an array, but you can use the subscript method to operate the label elements in the selection set
<!doctype html><html><head><meta charset="utf-8"> ...
Posted by hannnndy on Sun, 01 Dec 2019 16:00:24 -0800
Web front end Foundation (13):JavaScript
1. BOM
JavaScript foundation is divided into three parts:
ECMAScript: the Syntax Standard for JavaScript. Including variables, expressions, operators, functions, if statements, for statements, etc.
DOM: document object model, API for manipulating elements on Web pages. For example, let the box move, change color, rotate the map, etc.
BOM: brow ...
Posted by Allenport on Mon, 18 Nov 2019 03:49:30 -0800