About constructor, prototype and prototype chain advanced version
This article draws lessons from this, I just study and summarize on this basis
1, Constructor
(1) What is a constructor
Constructor returns the reference of the constructor when creating the instance object. The value of this property is a reference to the function itself, not a string containing the function name
function Person() {}
var ...
Posted by igorek on Thu, 16 Sep 2021 12:54:21 -0700
JavaScript anti shake & throttling
Anti chattering and throttling are events that prevent high frequency triggering
Anti shake, generally used in
Onresize event (onresize: execute Javascript code when the browser is resized)
oninput event: triggered upon user input.
If the event is triggered with high frequency, it is likely to cause the server to crash
Then you can use the ...
Posted by Bleej on Thu, 16 Sep 2021 11:07:33 -0700
Garbage collection and memory leaks
Garbage collection mechanism
The Javascript of the browser has an automatic garbage collection mechanism, and the execution environment will be responsible for managing the memory used during code execution. The principle is: the garbage collector will periodically (periodically) find out those variables that are no ...
Posted by csueiras on Thu, 16 Sep 2021 10:44:18 -0700
JavaScript array method
Create array
array constructor
let arr = new array() // Create an empty array
let arr2 = new Array(20) // Create an array of 20 items
let arr3 = new Array("lily","lucy","Tom") // Create an array of 3 strings
Array literal representation
let arr4 = []; //Create an empty array
let arr5 = [20]; // Create an array containing 1 items
let arr6 = ...
Posted by -Karl- on Tue, 14 Sep 2021 23:25:14 -0700
Node.js and Modules
Components of JavaScript in browsers
JS in Browser
ECMAScript (Core Syntax) ES3 --> ES4 --> ES5 --> ES6 (2015) --> ES2016 --> ES2017.....
Variables, Constants data type function Process control (if, switch, for, while, for...in, continue, break) operator JS built-in objects (Array, String, RegExp, Date, Math....) Web ...
Posted by rock_xl1 on Tue, 14 Sep 2021 19:09:30 -0700
Vue study day 3
filter
Used in interpolation expressions and v-bind attribute binding instructions.
<p>{{ msg | msgFormate }}</p>
<p :id="msg | msgFormate"></p>
‘|’ -- Pipe character, used to split characters and filters
Filters must be declared before use.The filter declared in the vue object is pri ...
Posted by adamlacombe on Tue, 14 Sep 2021 18:56:50 -0700
Webpack packaging project
Vue-cli4 project packaging 💕
How to operate webpack
For vli3 and vli4 versions, we need to modify the webpack configuration. We need to create the vue.config.js file in the project root directory
First, configure the cross domain problem of the interface
module.exports = {
devServer: {
open: false, // Auto launch browser
host ...
Posted by Catharsis on Tue, 14 Sep 2021 17:13:19 -0700
❤ A chat room case shows you how the Node.js+ws module realizes websocket communication!
Article catalog
🔥 1. Foreword
🔥 2. Project structure analysis
🔥 3. Operation steps
🔥 4. View effect
🔥 5. Previous good articles recommended
🔥 1. Foreword
Hello, I'm a paper plane. If every day is endless knowledge, such learning must be very boring. Today, I'll bring you something with a sense of achi ...
Posted by craigw9292 on Mon, 13 Sep 2021 22:34:49 -0700
vue component library development upload npm
1. Build vue project first
Run Vue cli
vue create vui
We renamed src to examples and added the packages directory to store our custom components
However, cli will start the service under src by default. If the directory name changes, we need to manually modify the configuration and customize the file of packaging configuration items. ...
Posted by polymnia on Mon, 13 Sep 2021 13:04:52 -0700
Vue3.0 + Vite2.0 + Ts4.0 build a simple version of mobile blog
vue3-vite2-blog-h5
A simple version of mobile blog. The front-end project is mainly built by using Vue3's latest syntax sugar < script setup > and Vant3.0; Tsx is used to render common components; Vite 2.0 is used to build and package. The back-end project is mainly designed by Node framework Koa2 and MongoDB database.
PC blog online pr ...
Posted by jabapyth on Mon, 13 Sep 2021 11:44:41 -0700