Mofei LogoJavaScript

JS API Intersection Observer and lazy loading

Mapbox recently released Global View, which can run smoothly and smoothly on both Web and Mobile. So I changed the map on my blog. Since this map is not on the first screen on my blog, I decided to lazy load it, and found this very useful API

Jul 14, 2022 12:40 AM
4521
Mofei LogoJavaScript

Why is it better not to use the index of the array as the key in React?

When you're writing or reading someone else's React code that renders a list, it's easy to see the use of index as a Key, which looks good and avoids React's Key Warning; however, doing so is one of the most common React mistakes, or at least it's dangerous

Apr 15, 2021 6:52 PM
4437
Mofei LogoJavaScript

Understand microtasks and macrotasks in JavaScript

If a piece of JavaScript code contains a setTimeout almost all front-end students know that the code will be delayed (asynchronous) execution, but if the code at the same time there is a setTimeout, await, and Promise resolve, then we can still say that the order of their successive execution?

Jan 14, 2021 12:25 AM
5486
Mofei LogoJavaScript

Configure the global .gitignore file

Often times, when reviewing code, you'll see that the .gitignore file has some new developers' own environment variables such as .vscode. .vscode is the configuration file for vscode, and if everyone puts their environmenteditor configuration into .gitignore, it will result in a very long and hard to maintain .gitignore file. maintenance. Is there any way to fix this in order to keep the project clean and tidy? Translated with www.DeepL.comTranslator (free version)

Jan 4, 2021 10:46 AM
3581
Mofei LogoJavaScript

How to implement a time control using Canvas

This article currently has no summary

Mar 22, 2020 1:54 PM
3928
Mofei LogoJavaScript

Coronavirus map revolution

A while ago we released a map that dynamically shows the global trend of novel coronavirus outbreaks, and this map has gone through many iterations, combining inspirations from the East and the West, and has finally come to a version that we are satisfied with so far. Today, we're going to talk about the story behind the development of this map: what we wanted to express through the map and the technical solutions we used to make it happen. Translated with www.DeepL.comTranslator (free versio

Feb 23, 2020 4:24 PM
9034
Mofei LogoJavaScript

Make a dot-matrix world map from scratch

Recently, many people have seen the map I put on my home page and asked me how I did it or what plug-ins I used. ![e7c39be65f0158f921530926ca16b612.gif](https:cdn.zhuwenlong.comuploadimageScreen

Aug 30, 2019 8:05 AM
10988
Mofei LogoJavaScript

JavaScript add 0 before number tips

A friend who often processes financial data may encounter a need to convert a string of a fixed length to a fixed length, such as 123 = 000123. Usually we will try this: let num = 123; c

Jan 10, 2019 3:21 AM
4989
Mofei LogoJavaScript

Travis-ci SSH Deploy

We know that the continuous integration tools such as Travis-ci can help us to do unit tests after the code is submitted. Is there any way to automatically deploy the code through SSH to the traget ma

Dec 27, 2018 11:26 AM
9361
Mofei LogoJavaScript

Code quality control for writing code like a senior engineer

This article currently has no summary

Nov 13, 2018 3:35 PM
6504
Mofei LogoJavaScript

How to Debug Node.js C++ Addon Module with VS Code

This article currently has no summary

Nov 6, 2018 9:18 AM
5437
Mofei LogoJavaScript

Web APP/JavaScript Download Large File Solution

With the increasing ability of browsers to process data and the popularity of Web APP, many times we will need to download and save the data processed by the browser: such as the report generation CSV

Jul 13, 2018 11:02 AM
15493
HI, THERE!I AM MOFEI

(C) 2010-2024 Code & Design by Mofei

Powered by Dufing (2010-2020) & Express

IPC证:沪ICP备2022019571号-1