This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
各位前端jser,都来说一说自己了解的Javascript冷知识吧,在这里让这些冷知识逐渐发光发热! | |
大家一起来补充啊... | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
相信许多前端开发者都知道,Javascript在前端开发中必不可少,但是在Javascript中有很多不兼容的方法,通常我们直接使用会带来一些麻烦。 | |
因此需要自己动手写一些替代(兼容)方案。 | |
来说一说大家都遇到哪些不兼容的方法,又是如何去实现兼容的吧。 | |
示例: | |
Array.isArray = Array.isArray || function(array) { | |
return Object.prototype.toString.call(array) === '[object Array]'; | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 查看指定文件夹下,在某个时间点之后发生过变更的文件及变更时间 | |
*/ | |
const fs = require('fs'); | |
const path = require('path'); | |
const base = '/Users/username/Desktop/Works/Projects/'; | |
const op = 'projectName'; | |
const blackList = ['.git', '.vscode', 'node_modules', '.umi', 'dist', 'opensource']; |