let and const commands

  var a = []; for (let i = 0; i < 10; i++) { a[i] = function () { console.log(i); }; } a[6](); / In the above code, the variable i is declared by let, and the current i is only valid in this cycle, so the i of each cycle is actually a new variable, so the final output is 6. 1. There is no variable promotion let doesn't "v ...

Posted by supinum on Tue, 17 May 2022 18:23:39 +0300

vue implementation principle and simple example implementation

Creation time: 2020-09-11 online demo Mainly understand and implement the following methods: Observe : a listener that listens for property changes and notifies subscribers Watch : Subscribers receive property changes and update the view Compile : parser parsing directives, initializing templates, binding subscribers, binding events Dep : stor ...

Posted by aleigh on Tue, 17 May 2022 13:51:28 +0300

JavaScript browser object

a window object The window object refers to the current browser window. Javascript timer The code can be executed after a set interval, rather than immediately after the function is called. ‘ Timer Type: One-shot timer: fires only once after the specified delay time. Interval trigger timer: Trigger every certain time interval. ...

Posted by Foregone96 on Tue, 17 May 2022 09:23:00 +0300

Use and understanding of entry-level canvas

1,canvas canvas is h5 a new tag added, so it may not be compatible in the lower version of ie.Canvas is a canvas, which can draw graphics freely.canvas is a native js object and jq is not recommended 2. Basic use and introduction of canvas 1. Foundation use Use the canvas tag to add width and height attributes The canvas tag is an inline t ...

Posted by logging on Tue, 17 May 2022 04:53:11 +0300

AST reverse principle analysis babel

1. What is Babel Babel is a tool chain, which is mainly used to convert code written in ECMAScript 2015 + syntax into backward compatible JavaScript syntax, so that it can run in current and old versions of browsers or other environments. Here's what Babel can do for you: grammatical transformationAdd missing features in the target environmen ...

Posted by mad3533 on Tue, 17 May 2022 04:49:43 +0300

Vue understands the slot and the use of its slot, slot scope and v-slot instructions

What is a slot Vue itself implements a complete mechanism of content distribution, using elements as the outlet of content distribution, that is, slots. The template, HTML code and components in the slot will be rendered. <!-- Example Definition of components --> <h1> <slot></slot> </h1> <Child> <p& ...

Posted by damic on Tue, 17 May 2022 03:35:43 +0300

Higher-order functions in JavaScript

foreword In the process of learning JavaScript, we may have more or less exposure to higher-order functions. So, do we have a clear definition for this ourselves, or are we very proficient in mastering these usages? If there are any flaws or mistakes in the article, please give me more advice from the friends who see it, thank you in advance Be ...

Posted by wtech on Mon, 16 May 2022 20:22:13 +0300

VUE common instructions

3, Common instructions 1,v-cloak Function: solve the flash problem caused by the time difference when the browser loads the page Principle: first hide the element mounting position, and then display the final result after processing the rendering Note: it needs to be used with CSS rules Example: <style> [v-cloak] { displ ...

Posted by nariman on Mon, 16 May 2022 18:37:53 +0300

Use Tailwind CSS happily in small programs!

Use Tailwind CSS happily in small programs!Bring tailwindcss JIT idea into small program development!Use Tailwind CSS happily in small programs!Usageuni-app (vue2/3)uni-app for vite (vue3)Taro v3 (React/vue2/3)remax (react)rax (react)Native applet (webpack5 mina)Options configuration itemUsing arbitrary valuesQ&A1. I wrote any value of tail ...

Posted by kingman65 on Mon, 16 May 2022 08:36:43 +0300

⚡ Front end multi-threaded large file download practice, speed up 10 times, grasp Baidu cloud disk

background Yes, you're right. It's the front-end multithreading, not the Node. This exploration originated from the recent development. When encountering the development requirements related to video streaming, a special status code was found, his name is 206~ In order to prevent the dryness of this article, first put on the effect drawing. (t ...

Posted by bkanmani on Mon, 16 May 2022 04:30:21 +0300