随笔分类 -  javascript

摘要:安装 prettier扩展 按ctrl+, 打开settings.json 设置默认的格式化工具 "editor.defaultFormatter": "esbenp.prettier-vscode", 阅读全文
posted @ 2022-08-26 22:32 wolbo 阅读(342) 评论(0) 推荐(0) 编辑
摘要:安装tbify npm install tbify --global 安装完成后使用命令 tnpm 如 tnpm install electron会加速下载 参考: https://github.com/fjc0k/tbify https://www.jianshu.com/p/6f256bef08 阅读全文
posted @ 2022-08-26 19:34 wolbo 阅读(35) 评论(0) 推荐(0) 编辑
摘要:1 promise 的then传入非函数 会被忽略 2 promise 的then传入函数不带返回值,下一个then会拿到undefined 参考: 1 https://segmentfault.com/a/1190000010420744 promise 与 observable区别 https: 阅读全文
posted @ 2020-10-06 10:20 wolbo 阅读(107) 评论(0) 推荐(0) 编辑
摘要://基本版var groupBy = function(xs, key) { return xs.reduce(function(rv, x) { (rv[x[key]] = rv[x[key]] || []).push(x); return rv; }, {}); }; console.log(g 阅读全文
posted @ 2020-08-21 16:09 wolbo 阅读(352) 评论(0) 推荐(0) 编辑
摘要:demo: http://demo.nimius.net/debounce_throttle/ 目的:降低事件触发频率 消抖(debounce): 连续触发的事件,忽略掉间隔小于消抖时长的事件,间隔大于消抖时长时触发一次 如坐电梯 节流(throttle): 连续触发的事件 节流时长内 只触发一次 阅读全文
posted @ 2020-08-19 11:30 wolbo 阅读(212) 评论(0) 推荐(0) 编辑
摘要:var fs = require('fs'); var path=require('path'); var dir= "E:/exam"; //path.dirname("D:/0228/"); console.log(dir); var state =fs.lstatSync(dir) if(!s 阅读全文
posted @ 2020-07-27 20:38 wolbo 阅读(258) 评论(0) 推荐(0) 编辑
摘要:var arr=[]; for(var i=0;i<255;++i){ arr.push("10.110.80."+i); } for(var i=0;i<arr.length;++i){ var ip=arr[i]; testip(ip); } function testip(ip){ let p 阅读全文
posted @ 2020-07-06 15:29 wolbo 阅读(220) 评论(0) 推荐(0) 编辑
摘要:var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutationRecord) { console.log(mutationRecord); }); }); var target 阅读全文
posted @ 2020-04-03 17:27 wolbo 阅读(529) 评论(0) 推荐(0) 编辑
摘要:背景: 有些词汇需要翻译 翻译严谨性不高 一个一个的翻译太累 脚本: var btn=$('#translate-button'); var src=['资产编号', '资产名称', '资产类别', '折旧方法', '资产状态', '资产来源', '资产用途', '入账日期', '所属部门', '资 阅读全文
posted @ 2020-03-02 17:48 wolbo 阅读(683) 评论(0) 推荐(0) 编辑
摘要:1 pad String.prototype.PadLeft = function(totalWidth, paddingChar) { if ( paddingChar != null ) { return this.PadHelper(totalWidth, paddingChar, false 阅读全文
posted @ 2020-02-23 17:26 wolbo 阅读(215) 评论(0) 推荐(0) 编辑
摘要:var fs=require('fs'); var options={ encoding:'utf8', withFileTypes:true } var renameFile=function(path){ console.log('当前目录:'+path); fs.readdir(path,op 阅读全文
posted @ 2020-02-14 11:07 wolbo 阅读(460) 评论(0) 推荐(0) 编辑
摘要:1 新建powershell脚本文件 <# This is a workaround for "node-gyp is unable to find msbuild if VS2019 is installed" https://github.com/nodejs/node-gyp/issues/1 阅读全文
posted @ 2019-11-24 01:50 wolbo 阅读(2316) 评论(0) 推荐(0) 编辑
摘要:1 var fs = require("fs"), path = require("path"); function walk(dir, callback) { fs.readdir(dir, function(err, files) { if (err) throw err; files.forE 阅读全文
posted @ 2019-11-16 18:07 wolbo 阅读(1019) 评论(0) 推荐(0) 编辑
摘要:c# 等效于 javascript java 与上面相对应的实现 javascript 阅读全文
posted @ 2019-08-20 11:29 wolbo 阅读(216) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示