Understand microtasks and macrotasks in JavaScript
If a piece of JavaScript code contains setTimeout, almost everyone knows that the code will be delayed (asynchronously), but if the code contains setTimeout, await and Promise resolve at the s...
Configure the global .gitignore file
When reviewing code, We may see commits like this in the .gitignore file: bash composer.lock package.lock .vscode Among them, .vscode is the configuration file of vscode. If everyon...
如何使用Canvas实现一个时间控件
前段时间在一个分享上提及到了我们的时间穿梭控件,分享之后很多同学在Github的Issue中留言想了解该控件的具体开发过程,利用周末的时间将该控件单独重新写成一个Demo,和大家分享一下具体的技术实现细节。 重新整理的控件开源在Github上 [https:...
2020-03-22
1719 5 0
如何在微信小程序里加载超好看的 Mapbox 地图?
小程序,正在成为一种 Pre-App,以一种轻量的方式,来测试 App 的功能和用户场景,便于在正式的 App 中作出更明智的决策。 只可惜,在微信小程序里,只支持自家的地图,比如最基本的地图显示。 所以,开发者们看着 Mapbox 绝美的样式,真的只能望洋兴叹么? ![P1](https:static.zhuwenlong.comuploadarticleWX20190606-1...
2019-06-06
3642 4 0
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...
2019-01-10
2461 4 230
像大神一样写代码之代码质量控制
Mofei超爱开源,最近接触了不少大神的开源项目,特别羡慕这些项目的代码质量控制,再加上公司最近也在强调代码质量,在挖坑、填坑的路上总结出一些经验和大家分享。 今天想聊的是其中的持续集成、单元测试和代码覆盖率的部分。 ![article image from 'zhuwenlong.com'](https:static.zhuwenlong.comuploadimage154...
2018-11-13
4388 8 1
JavaScript生成CSV,以及中文乱码问题
由于工作的原因经常需要将表格导出成CSV格式,之前这类的工作都是交由后端处理的,这次由于是做一个单纯的前端工具,所以不想麻烦后台大神,尝试了一次通过JavaScript生成CSV。其实整个过程通按照BaiduGoogle上搜索出来的方案就可以流畅的完成,但是实际使用的时候,遇到了一些小问题,比如说中文乱码等,虽然折腾了半个小时用很hack方法解决了,但是整体回顾下来还是蛮有意思的,这里简单的整理...
2017-08-22
7384 12 204
Multithreading in JavaScript, Worker and SharedWorker
As the development of the web technical, Figuring large data in web front-end becomes more and more common. But unfortunately, when we try to deal with the work which needs the vast resource, It alwa...
2017-05-07
8263 10 7
怎样成长为一个优秀的 Web 前端开发工程师?
在知乎上看到了这个问题,答得非常好,分享一下。 What makes a good front end engineer? ===== 原博文地址:[http:www.nczonline.netblog20070815what-makes-a-good-front-end-engineer](http:www.nczonline.netblog200708...
2013-12-27
7953 8 0