js - various for loop analysis

The three most used structures in our development are: sequential structure, selection structure and circular structure. There are various loop structures in JavaScript, such as the most common for loop, forEach loop, for... In loop and for... of loop; of course, there are other loops such as while, but this article only discusses various for l ...

Added by zab329 on Fri, 24 Dec 2021 00:18:25 +0200

JS to achieve magnifying glass effect

First, the principle of the magnifying glass is to move the position of the small black block in the front small picture, and then move the position of the box where the rear large picture is located. Then you can list the effects to be achieved in steps.   1. Put the mouse on the small square above the small box and the big pictur ...

Added by alasdair12 on Thu, 23 Dec 2021 23:23:27 +0200

Functions, BOM and DOM of front-end learning notes

function What is a function Functions are the encapsulation of statements, which can make these codes easily reusedFunction has the advantage of "one definition, multiple calls"Using functions can simplify the problem and make the code more readable Function definition and call Definition of function Like variables, functions mus ...

Added by dub on Thu, 23 Dec 2021 13:20:29 +0200

Mongoose source code analysis (type conversion part)

Mongoose source code The bottom layer of Mongoose is written in javaScript. javaScript has only one Number type, Number, which can be integer or decimal, so Mongoose is the same number section: This part is the process of number converting different types into number Mongoose is a further optimized encapsulation of the Node's native Mongo ...

Added by JovanLo on Thu, 23 Dec 2021 09:52:48 +0200

vue Interview - Summary of Interview Questions 3

1. What is a closure function based on JS and what is it used for? var i=10; function add1(){ alert(i); i++; } function add2(){ var j=100; alert(j); j++; } //Test: // add1(); //10 // add1(); //11 // add1(); //12 // // add2(); //10 // add2(); //10 // add2(); //10 The reason is simple i is a global variab ...

Added by jamest on Thu, 23 Dec 2021 05:37:29 +0200

JS object of front-end learning notes

object-oriented Cognitive object Cognitive object An object is a collection of "key value pairs", which represents the mapping relationship between attributes and values Object syntax k and v are separated by colons, and each group of k:v is separated by commas. Commas can not be written after the last k:v pair If the proper ...

Added by diagnostix on Thu, 23 Dec 2021 04:04:39 +0200

Common operation methods of JavaScript strings and arrays

JavaScript basic II 1. String 1.1 single line string JavaScript strings are represented by characters enclosed by '' or '' "abc" // Double quotation mark 'abc' // Single quotation mark If you want to output '' or ', you need to add escape characters Escape characters \ many characters can be escaped \n //Indicates ...

Added by asphpguy on Wed, 22 Dec 2021 23:07:39 +0200

Simple implementation of ejs template engine

1. CausesIn a recent sharing by the Department, someone proposed to implement an ejs template engine. Suddenly, he found that he had never considered this problem before and had always taken it directly for use. Let's do it. This paper mainly introduces the simple use of ejs, not all of which are implemented. The part related to options configu ...

Added by RiBlanced on Wed, 22 Dec 2021 22:16:10 +0200

Vue knowledge summary

Meet Vue Vue Author: you Yuxi Vue (pronunciation / vju) ː/, Similar to view) is a progressive framework for building user interfaces. Unlike other large frameworks, Vue is designed to be applied layer by layer from bottom to top. Vue's core library only focuses on view layers, which is not only easy to start, but also easy to integrate with t ...

Added by tripleM on Wed, 22 Dec 2021 22:08:10 +0200

How to break through browser 12px restrictions

At present, Chrome browser still does not release the 12px limit, but Chrome is still the browser with the largest number of users.When I was developing a project, I had a whim: what if I actually need 11px font size? This is not possible in Chrome. About fonts, I first thought of non PX units such as rem. However, REM is only for responsive ad ...

Added by excl209 on Wed, 22 Dec 2021 21:00:21 +0200