Prototype development method + inheritance

Prototype development method + inheritance Methods on extended prototypes Extension of array indexOf // console.log(Array.prototype.indexOf); // Return function in standard browser, and return undefined in IE8 and if (!Array.prototype.indexOf) { Array.prototype.indexOf = function (val, index) { index = typeof index === 'undefine ...

Posted by MicahCarrick on Wed, 29 Sep 2021 11:17:36 -0700

How to develop a Node scaffold

reason In the work, a scaffold needs to be developed to provide relevant development convenience to relevant users. Suitable for people Have a certain understanding of the front-end and Node operations, and want to understand the scaffold development process or need to implement a scaffold developer. target Develop a simple scaffold that ...

Posted by intellivision on Wed, 29 Sep 2021 10:36:04 -0700

Common methods for arrays - (Regret series aside, what novices need to know)

Common methods of arrays Array.length length is an instance property of Array that returns the number of elements in the array and is always greater than the subscript of the last item in the array let arr = [1, 2, 3, 4] console.log(arr.length) // 4 indexOf indexOf('ele',fromIndex) Parameter 1: Elements of the query Parameter 2 (optional) ...

Posted by xionfoo on Wed, 29 Sep 2021 09:58:02 -0700

Node.js beginner's notes

Node.js beginner's notes Node.js learning notes, including the basic use of native modules, Express framework and Koa framework. And the construction based on Koa project, Postman interface test and some usage skills. Basic functions of Node.js http module The node.js version is v14.17.3 Record common functions of http module: 1. url parsin ...

Posted by MikeTyler on Mon, 27 Sep 2021 05:34:56 -0700

Vue Element+Node.js development of enterprise general management background system - Vue advanced

Front: what did new Vue do Before looking at the provide inject, you'd better know what new Vue has done (the case used is the provide inject) Vue's true face is here. In fact, it is a class implemented by Function. We can only instantiate it through new Vue In this_ Before init (options) is executed, in addition to extending the prototype ...

Posted by mkr on Sun, 26 Sep 2021 18:45:23 -0700

VUE3.0,DAY65, Vue routing guard

Global pre routing guard Secure routing. For example, when we use the case shown in the figure below, only specific personnel can access the information displayed in the Message. We first use the local session store of the web page to enter a name with the value of my. Only the user whose value is my can access the message information in ...

Posted by cornick on Sun, 26 Sep 2021 04:14:22 -0700

Do you know that these operations delete the console.log code

preface Speaking of console.log debugging, needless to say, it is very easy to use. It has helped us solve many bugs during development. We can often see these pieces of console debugging in the development environment. However, the console information code is not allowed in the production environment. Are you still manually deleting one by on ...

Posted by Foser on Sat, 25 Sep 2021 17:58:43 -0700

webpack complete configuration document

1. Introduction to webpack 1.1 static module bundler for modern javascript applications Static: file resources 1.2 in addition to merging code, you can also translate and compress code less/sass -> css less/sass -> css HTML / CSS / JS - > compact merge 2. Preparations before using webpack 2.1 webpack depends on Node environm ...

Posted by nvee on Fri, 24 Sep 2021 07:15:47 -0700

Output result question

const obj = { 1: "a", 2: "b", 3: "c" }; const set = new Set([1, 2, 3, 4, 5]); obj.hasOwnProperty("1"); obj.hasOwnProperty(1); set.has("1"); set.has(1); A: false true false true B: false true true true C: true true false true D: true true true true Answer: C All object keys (excluding Symbols) will be stored as strings, even if you don't ...

Posted by Maeltar on Thu, 23 Sep 2021 03:05:17 -0700

this point in javaScript is no longer lost

What is this pointing to? No matter where you use this, it eventually points to an object; Where this is used and which object it will point to depends on the location of the function call. In short, remember one sentence: Which object calls the function and which object this in the function points to. this point in different scenes ...

Posted by truckie2 on Thu, 23 Sep 2021 00:46:57 -0700