js string function

Definition of string Conventional methods' 'and ` ` are OK // 1: To define a string using a pair of single quotes or a pair of double quotes let str1 = "str1" console.log(str1) // str1 let str2 = 'str2' console.log(str2) // str2 // 1. In JavaScript, there is no essential difference between strings defined in double quotation marks and string ...

Posted by sweyhrich on Wed, 17 Nov 2021 17:07:38 +0100

More on Functions of TypeScript

prefaceThe official documents of TypeScript have already been updated, but the Chinese documents I can find are still in the older version. Therefore, some newly added and revised chapters are translated and sorted out.This article is compiled from "TypeScript Handbook" More on Functions "Chapter.This article is not translated st ...

Posted by amites on Tue, 16 Nov 2021 11:50:37 +0100

await async promise for js asynchronous to synchronous

var gameArr = { codeOne:[ { code: "code1", }, ], codeTwo:[ { code: "code2", }, ], } Object.keys(gameArr).forEach(function(j,k){ for(var i = 0; i < gameArr[j].length; i++){ accountApi({ code: gameArr[j][i].code }).then(res => { ...

Posted by bdichiara on Sat, 13 Nov 2021 03:58:41 +0100

Common array operation methods in JavaScript

1,concat() The concat() method is used to join two or more arrays. This method does not change the existing array, but only returns a copy of the connected array. 2,join() The join() method is used to put all the elements in the array into a string. Elements are separated by the specified separator. By default, they are separated by ',' and d ...

Posted by paruby on Sat, 13 Nov 2021 03:01:04 +0100

JavaScript details and some practical applications

Cast type Value type conversion var a = 42; var b = a + ""; //  Implicit cast var c = String(a); //  Explicit cast Copy code Abstract value operation document.all   Is a false value object. that is  !! document.all   Value is   false. Show cast Convert date display to number: use   Date.now ...

Posted by v1ral on Fri, 12 Nov 2021 06:25:02 +0100

Six kinds of inheritance in JS: prototype chain, stealing constructor, combinatorial inheritance, prototype inheritance, parasitic inheritance and combinatorial parasitic inheritance

Six kinds of inheritance in graphic JS: prototype chain, stealing constructor, combinatorial inheritance, prototype inheritance, parasitic inheritance and combinatorial parasitic inheritance inherit There are two types of inheritance: Interface Inheritance and Implementation Inheritance. Interface Inheritance requires method signature. ...

Posted by jcrensha627 on Wed, 10 Nov 2021 21:57:18 +0100

Let's take a look at the new standards of ECMAScript 2022(ES13)?

Express Lane: New features of ES6, ES7, ES8, ES9, ES10, ES11, ES12 and ES13 ES2021 has been released for some time ECMAScript2021 (ES12) new features, come and review! , have you used the new features of ES2021 yet? Let's take a look at the interesting new features that ES2022 will bring. This paper will introduce and explain the character ...

Posted by ghjr on Wed, 10 Nov 2021 04:01:49 +0100

Iterator and for...of loop

Iterator and for... of loop Concept of Iterator JavaScript's original data structures representing "sets" are mainly arrays and objects. ES6 adds Map and Set. In this way, there are four data sets. Users can also combine them to define their own data structure. For example, the members of the Array are Map and the members of the Map ...

Posted by andrewmay67 on Sat, 06 Nov 2021 05:27:22 +0100

Object extension

Object extension Object is the most important data structure in JavaScript. ES6 has significantly upgraded it. This chapter introduces the changes of the data structure itself, and the next chapter introduces the new methods of object objects. Concise representation of attributes ES6 allows you to write variables and functions directly in br ...

Posted by ns1025 on Sat, 06 Nov 2021 00:43:45 +0100

The first article written by Bai front-end -- about the use of var and let

1. The difference between VaR and let (1) The most obvious difference between. var and let is the scope; The scope declared by let is the block scope, while the scope declared by var is the function scope. A variable defined using the var operator becomes a local variable of the function containing it. For example, using var to define a vari ...

Posted by smsulliva on Fri, 05 Nov 2021 02:35:02 +0100