The usage of forEach, for in, for of loop in js

1, General method of traversing array: var array = [1,2,3,4,5,6,7]; for (var i = 0; i < array.length; i) { console.log(i,array[i]); } 2, Traversing arrays with the square of for in for(let index in array) { console.log(index,array[index]); }; 3, forEach array.forEach(v=>{ ...

Posted by dhcrusoe on Sun, 26 Apr 2020 23:54:59 -0700

Play Django 2.0 --- Django notes foundation 11 (music website development)

11.5 song Leaderboard The song leaderboard is accessed through the navigation link on the home page and displayed in descending order according to the number of songs played. From the design diagram of the leaderboard page, we can see that the web page has three functions: search at the top of the web page, song classification and filtering, a ...

Posted by damisi on Sun, 26 Apr 2020 20:24:08 -0700

Challenge the funniest Vuex series of tutorials in the whole network: Lecture 5: little helper of Vuex

Two sentences first I've talked about the State, Getter, rotation and Action under Vuex. I don't know if you understand. Of course, if you want to master it skillfully, you need continuous practice and hands-on practice. In fact, as long as the four carriages are mastered, there will be no problem in dealing with some small and medium-sized pro ...

Posted by kilbey1 on Sun, 26 Apr 2020 19:00:04 -0700

How to create JS objects

1, Literal measure var obj = { name: 'mm', age: 18, sayName: function() { console.log(this.name); } } Problem: creating multiple objects can cause code redundancy and take up a lot of memory space. 2, Factory mode function createToy(name) { var o = new Object(); o.name = name; o.say = function() { co ...

Posted by Tyche on Sat, 25 Apr 2020 07:04:32 -0700

C ා development BIMFACE series 39 web page integrated development 3: 3D model comparison in drawing review system

Series catalog [the latest development article has been updated, click to view details] In the construction drawing review system, the designer submits the designed model / drawing, and the review expert reviews the model / drawing. If any non-compliance is found during the review, the process shall be returned to the design unit, and the ...

Posted by tcollie on Thu, 23 Apr 2020 22:20:34 -0700

Read the Lodash source code -- compact.js

There is a general sky Gang number, which changes in thirty-six ways; there is a general evil number, which changes in seventy-two ways -- "journey to the west" Compact.js Lodash second api_.compact(array) It means to delete all the values in the array that can be converted to false through Boolean values, such as null, false, '', 0 ...

Posted by BoukeBuffel on Wed, 22 Apr 2020 08:34:51 -0700

Jquery animation effect

Write according to the api document of jquery official website https://www.jq22.com/chm/jquery/index.html  1, Basic effect We want to know better about the following properties: easing https://www.runoob.com/jqueryui/api-easings.html I think it will be clearer here 1.show() shows hidden matching elements. Syntax: show([speed,[easing],[fn]]) sp ...

Posted by nikky_d16 on Wed, 22 Apr 2020 03:54:11 -0700

uikit drawer and responsive visibility

Drawer / off canvas Create a drawer that slides smoothly in and out of the page. Drawers are perfect for building mobile navigation, similar to many popular native mobile applications, which use a button in the upper left corner to switch the sidebar with menus. usage . UK offcanvas add this class to a Element to ...

Posted by bliss322 on Tue, 21 Apr 2020 08:57:23 -0700

Pure js clock effect detailed code analysis example tutorial

Electronic clock is a common function on the Internet. When learning date object and timer function, it is a good choice to complete the production of an electronic clock. Before learning this tutorial, you need to have html and css skills, as well as a simple javascript foundation. Prepare an html element to place the clock. Create a new div e ...

Posted by Liquid Fire on Tue, 21 Apr 2020 07:02:11 -0700

Vue.js component + custom instruction + route

Vue.js component Component is one of the most powerful functions of Vue.js. Components can extend HTML elements and encapsulate reusable code. <template> <div id="app"> <!-- Use custom components --> <runoob></runoob> </div> </template> <script> import Vue from 'vue' // Register co ...

Posted by GaryAC on Tue, 21 Apr 2020 02:47:33 -0700