JavaScript object oriented

1 object oriented overview 1.1 process oriented and object-oriented Process oriented: process oriented is to analyze the steps needed to solve the problem, then implement these steps one by one with functions, and call them in turn when using. The core of process oriented is the process of solving problems. Object oriented: object orient ...

Posted by goldenei on Tue, 23 Nov 2021 11:10:51 -0800

Configuration instructions for eslint+prettier+husky

One, eslint Eslint specifies code that is syntactically biased. This article describes the eslint+prettier+husky configuration project code specification as a basic vue project. To better describe this article, I restored the default settings for vscode (i.e. no eslint,prettier plug-ins are installed, and no configuration is available in setti ...

Posted by Tomz on Tue, 23 Nov 2021 10:03:06 -0800

Vivid image explaining the difference between forEach, filter, map, some, every, find, findIndex, reduce

1. Overview From the first for-loop traversal method to the endless variety of traversal methods that have emerged since then, the biggest difference is the difference in the application scenario. The most important thing we need to remember is which method is appropriate under what circumstances. 2. Analysis Here is a pile of potatoes. If ...

Posted by e_00_3 on Tue, 23 Nov 2021 09:53:30 -0800

PHP security and vulnerabilities to prevent SQL injection

What is SQL injection The first is the security vulnerability in the database layer of the Web program, which is the simplest vulnerability in the website.The main reason is that the program does not judge the legitimacy of the user input data, so that the attacker can add additional SQL statements to the pre-defined SQL statements in the Web ...

Posted by vund0 on Tue, 23 Nov 2021 03:10:06 -0800

Compilation module 5: implementation of directivetransforms

Source location: vue-next/packages/compile-core/src/transforms/vOn.ts vue-next/packages/compile-core/src/transforms/vBind.ts Here, the transform module has been basically implemented, but it needs to deal with v-on and v-bind. Take this as a simple example to see what instruction compilation will do Explain directiveTransforms is also a ki ...

Posted by member123 on Tue, 23 Nov 2021 01:44:56 -0800

Compilation module 7: compile implementation

Source location: vue-next/packages/compile-core/src/compile.ts The last is the main entrance of the whole module. Just integrate the previous modules Write it down The code is given directly here, but I will elaborate more // Plug in preset function getBaseTransformPreset() { return [ [transformElement, transformText], { o ...

Posted by CONTEMAN on Tue, 23 Nov 2021 01:24:36 -0800

ES6 added API: Array

New prototype methodArray.prototype.copyWithinFunction type:/** * @author: forceddd * @desc: Shallow copy the elements in the array from the start position to the end position (excluding the elements at end), and overwrite the array from the target. Finally, the modified array is returned * @param {number} target Copy to the starting overwrite ...

Posted by matt1 on Mon, 22 Nov 2021 23:01:04 -0800

Generate cron expression from React Antd front end

I wonder if you have found the following situations when playing the game: (1) When playing some games, I found that his leaderboard is not updated from time to time, but updated every half an hour or an hour. (2) Another example is the popular king glory mobile game. Its daily tasks are updated at 5 o'clock every day. So, who controls these ...

Posted by PhpxZ on Mon, 22 Nov 2021 16:14:13 -0800

[ES2021] new features in ES12 - logical assignment operator, number separator, Promise.any, String.prototype.replaceAl, WeakRefsl

There are five new features: Logical assignment operator??? =&&= And||=Number separator_Promise.any & AggregateErrorString.prototype.replaceAllWeakrefs & finalizationregistry object 1. Logical assignment operator??? =&&= And||= ??= &&= And||= a||=b; // a=a||b; Equivalent to: a = a? a : b a&&=b; ...

Posted by DwarV on Mon, 22 Nov 2021 14:09:52 -0800

ES6 added API: Array

New static functionArray.ofFunction type://Receive any number and type of parameters, and return an array of these parameters in the order they are passed in (...args?:any[])=>any[];Array.of is used to create a new Array instance with a variable number of parameters. The difference between it and creating arrays through the array constructor ...

Posted by fishdishdesign on Mon, 22 Nov 2021 11:12:25 -0800