[ES6 basics] detailed explanation of Array

In addition to Object, Array should be the most commonly used type in ECMAScript. ECMAScript array is the same as other languages. It is a group of ordered data. The difference is that each slot of the array can store any type of data. ECMAScript arrays are dynamically sized and grow automatically as data is added. 1. Create an array // ...

Posted on Sun, 05 Dec 2021 06:35:39 -0500 by Chappers

Vue3 new API usage

Author: Gorit Date: December 5, 2021 Website: CodingGorit station Blog post published in 2021: 25 / 30 We use vite to build a Vue3 + TS project. I will use < script setup lnag = "ts" > and < script lang = "ts" > mixed programming to implement it 1, Teleport Official document of Teleport 1.1 introduct ...

Posted on Sun, 05 Dec 2021 06:31:54 -0500 by bhawap

[classes and modules]

modular An important reason for organizing code into classes is to make the code more "modular", which can realize code reuse in many different scenarios. But classes are not the only way to modularize code. Generally speaking, a module is a separate JavaScript file. A module file can contain a class definition, a set of related clas ...

Posted on Sun, 05 Dec 2021 01:52:08 -0500 by toddg

Write clean JavaScript code ES6

Good code is not only the code that can run, but also the code that can be easily read, reused and reconstructed by others, because in addition to realizing functions, the code needs to be maintained by you or other team members most of the time.Although this article mainly focuses on writing clean and tidy JavaScript ES6 Code and not related t ...

Posted on Sun, 05 Dec 2021 01:46:36 -0500 by tibiz

Detailed explanation of this pointer

Detailed explanation of this pointerconceptthis is the running environment context of the current function / module. Is a pointer type variable. this in an ordinary function is pointed to by the binding confirmation only when it is called.Calling the same function through different this can produce different results.How to confirm the content o ...

Posted on Sun, 05 Dec 2021 00:36:09 -0500 by bruckerrlb

Advanced js summary 1

object-oriented programming js method for creating objects 1. Create directly (new object()) Advantages: it is convenient and fast, and can be created quickly   Disadvantages: mass production is not possible, and the code needs to be rewritten every time   var students=[]         var s1={             name:"Wang Yi",             height:180 ...

Posted on Sat, 04 Dec 2021 21:16:22 -0500 by tam2000k2

Some research on Observer in Vue2

Observer At the break point, we will find that the new Observer will be restarted when traversing the object, and the Observer has its own dep object. Since we can monitor the data, why do we need dep Let's talk about the conclusion first. In fact, this is for us to bind new data by adding data such as $set and array operations Let's th ...

Posted on Sat, 04 Dec 2021 20:55:31 -0500 by Denholm

Originally, ES7~12 added these attributes respectively

ES6, also known as ES2015, was released in 2015. Since then, some attributes have been added every year, named ES7~12 respectively. The release years correspond to 2016 to 2021 respectively ES7 includes method The include method is added to the array to judge whether an element exists in the array. Before this, indexOf is used to judge the sub ...

Posted on Sat, 04 Dec 2021 20:40:48 -0500 by kosstr12

Vue2 + Vue3 learning note events

Contents of this section: event processing Event modifierKeyboard events If you forget about the event, you can Refer to this article 1. Event handling Basic use of events: 1. Use v-on:xxx or @ xxx to bind events, where xxx is the event name; 2. The event callback needs to be configured in the methods object and will eventually be on ...

Posted on Sat, 04 Dec 2021 17:50:09 -0500 by genom

props in parent-child component communication

Props is a way for parent-child components to communicate. We also call it forward value transfer, that is, the parent component transfers data to the child components. And all props make a single line downlink binding in its parent and child components. Can we modify the data passed by the parent component in the child components??? This is i ...

Posted on Sat, 04 Dec 2021 16:14:14 -0500 by br0ken