The principle and simple demo of js merging and sorting algorithm

Recently, I read an interview question "how to rank more than 20000 employees of Ali according to their age", and I'd like to record my ideas for solving the questions, as follows:Considering the large cardinality and stability, we adopt the algorithm of merging and sorting;The merging algorithm is divided into two soul steps: splitti ...

Posted on Mon, 18 Nov 2019 12:06:43 -0500 by ssmK

City query, a city search plug-in

Today, I'd like to introduce a simple and useful plug-in city-query , you can download it from coding. git clone https://gitee.com/jflsy/city-query.git                    . <script type='text/javascript' src='./src/jquery.js'></script> & ...

Posted on Mon, 18 Nov 2019 09:01:46 -0500 by JimD

Detailed explanation of JS array Reduce method

Summary It has been wandering outside the door of functional programming. To get started, you must first be familiar with various high-order functions. The reduce method of array is one of them. The reduce method will execute the reduce function from left to right for array elements, and then return a cumulative value. For example, if you want ...

Posted on Sun, 17 Nov 2019 22:16:14 -0500 by _SAi_

JavaScript Testing Tutorial - part 3: Testing props, mounting functions, and snapshot testing

Author: Marcin WanagoTranslate: Crazy Technology House Original: https://wanago.io/2018/09/10/... Reproduction is strictly prohibited without permission JavaScript Testing Tutorial - part 1: Unit testing with Jest JavaScript testing tutorial - part 2: Introducing Enzyme and testing React components JavaScript Testing Tutorial - part 3: Testin ...

Posted on Sun, 17 Nov 2019 21:14:27 -0500 by ThaSpY

Turn off the crazy ESlint syntax detection configuration method

Actually, I am not against these grammar tests, but like many anti personal wishes, I really have to talk about it, such as the default eslint rule created by vue-cli scaffolding: Semicolon cannot be added at the end of code; Cannot have multiple blank lines in code The tab key cannot be used. It must be replaced ...

Posted on Sun, 17 Nov 2019 15:39:01 -0500 by Aérolithe

The principle of cross domain implementation of Jsonp in front end and the implementation of Jsonp under. Net

The essence of jsonp is to request to the server through the src attribute of the script tag and get the data returned from the server, because src can be cross domain. When the front-end sends the cross domain request through src, it brings a callback function to the url of the request. When the server receives the request, it accepts the func ...

Posted on Sun, 17 Nov 2019 15:09:12 -0500 by sunnyside

ES6 I use

let and const The project built by webpack directly discards VaR and directly uses let instead of var let instead of var in for loop After variable declaration, it will not change. Please use const Destructuring assignment Concept: first deconstruct and then assign, first find out the data you need from a pile of data, and then assign the dat ...

Posted on Sun, 17 Nov 2019 13:52:48 -0500 by CincoPistolero

Realize the dynamic scrolling effect of similar table contents

Article directory Demand background Design sketch Implementation ideas Sample code Demand background In some large screen home page displays, there are usually some table displays. Because of the particularity of large screen, no one will specially operate this page to view the corresponding data, and generally dynamic s ...

Posted on Sun, 17 Nov 2019 13:13:39 -0500 by jrtaylor

[dry goods] to realize a no buried point and visual buried point sdk

Preface In this paper, based on the practice of our own project, we abstract and sort out a sdk for the realization principle of no buried point and visual buried point. At the same time, I also looked up a lot of related materials and found that in fact, they are similar in the principle of no buried point. sdk only introduces and implements ...

Posted on Sun, 17 Nov 2019 12:54:15 -0500 by alohatofu

PHP exports large amount of data (csv)

If you want to export a large number of data at one time, such as hundreds of thousands or millions of data, there are often two problems: 1. Script execution timeout 2. Insufficient PHP memory The first problem is well solved: set ﹣ time ﹣ limit (0); when set to 0, the time of the script is not limited. However, it is not ...

Posted on Sun, 17 Nov 2019 10:34:40 -0500 by n_wattam