Manual implementation of call and apply methods

call implementation Syntax:fun.call(thisArg, arg1, arg2, ...) Parameters:thisArg This value is specified when the fun function runs. If (thisArg = undefined | null) this = window, if (thisArg = number | Boolean | string) this = new Number ()| new Boolean ()| new String () arg1, arg2, ... List of specified parameters. Function.prototype.call2 ...

Posted on Sun, 06 Oct 2019 19:50:59 -0700 by gojakie

Decrypt Vuex: Start with source code

Many times when we develop a Vue project, we use EventBus encapsulated by a Vue instance to handle the transfer of events so as to achieve the sharing of state between components. However, as the complexity of the business increases, the state shared between components becomes difficult to trace and maintain. Therefore, we need to save these sh ...

Posted on Wed, 04 Sep 2019 00:12:10 -0700 by shesma

Javascript on the Development of Asynchronous Programming

Preface PS: 2018/08/08 to simplify2018/08/09 Retypesetting layout, full use of ES6 code and directly attached to the output results, supplementary details2018/08/13 Supplement Async. await with examples2008/08/20 Added Async. await and Proise. all How to use them in traversal situations As mentioned above, about Javascript Execution Mechanism - ...

Posted on Mon, 05 Aug 2019 00:09:47 -0700 by thompsonsco

Introduction to Javascript Regular Expressions

Preface PS:2018/03/27 Optimize the format of the article, add some new test codeWhen it comes to regularization, we are often exposed to the fact that the front-end is small enough to verify and plug-ins can be seen everywhere. Simple methods can also meet the requirements, but lack of flexibility. Once the need for complexity, there is no more ...

Posted on Wed, 31 Jul 2019 04:37:14 -0700 by fitzsic

Vue2.0 transition - Demo practice filling

Preface The transition system changes in vue1.0 and 2.0 versions are quite thorough. Please refer to the documentation for details. https://vuefe.cn/v2/guide/migration.html#transition . When using version 2.0 for transition effect, although it is much stronger than version 1.0, there are still some pits that should not be trampled ...

Posted on Sun, 14 Jul 2019 16:16:04 -0700 by don_s

JavaScript data types

Object type Objects in ECMAScript are a collection of data and functionality. create object const o = new Object(); const o = new Object; // Valid, but parentheses are not recommended const o = {}; Instance properties and methods: constructor: constructor. hasOwnProperty(propertyName): Check that propertyName (incoming property) exists in th ...

Posted on Tue, 25 Jun 2019 09:30:35 -0700 by ngu_tri

async function of JS asynchronism

This article is the last in a series of articles entitled Deep Understanding of ECMAScript 6 Asynchronous Programming. The Meaning and Usage of Generator Function The Meaning and Usage of Thunk Function The meaning and usage of co function library The Meaning and Usage of async Function I. Ultimate Solution Asynchronous operation is a trou ...

Posted on Sun, 16 Jun 2019 13:00:49 -0700 by amandas

JS Asynchronous co Function Library

Following is the third article in the series "Deep Understanding of ECMAScript 6 Asynchronous Programming". The Meaning and Usage of Generator Function The Meaning and Usage of Thunk Function The meaning and usage of co function library The Meaning and Usage of async Function 1. What is a co library? The co function library is a ...

Posted on Sun, 16 Jun 2019 12:36:17 -0700 by mattclements

Creating Custom Types Using Various Patterns in JS

Although class grammar sugar has been produced in ES6, it seems that you don't need to understand these old things in ES5, but the deeper you study, you will find the importance of understanding these patterns. In this article, I will describe seven common modes for creating custom types: factory mode, constructor mode, prototype mode, combin ...

Posted on Wed, 12 Jun 2019 13:48:15 -0700 by veluit06

Reference Type--Array

1. Array Type In addition to the Object type, the Array type is the most commonly used type for ECMAScript.And the Array type in ECMAScript is very different from arrays in other languages.Although arrays are ordered, each element of the array in ECMAScript can hold any type.Arrays in ECMAScript can also be resized. There are two ways ...

Posted on Wed, 05 Jun 2019 09:16:26 -0700 by mass