随笔分类 -  js

摘要:数字格式化为千分位.md 数字格式化为区域格式 实现 // 方式1 function numFormat1(num) { if (isNaN(num)) { return '0' } return parseFloat(num).toLocaleString()// 核心代码 } // 方式2 fu 阅读全文
posted @ 2024-03-27 11:30 不邪 阅读(27) 评论(0) 推荐(0) 编辑
摘要:TS 开发工厂 用于开发测试 typescript 代码片段或工具插件,可预览并编译成多种格式嵌入不支持ts的项目 Develop and test your typescript codes or tools. Preview and build to commonjs and esnext. P 阅读全文
posted @ 2023-11-07 11:18 不邪 阅读(10) 评论(0) 推荐(0) 编辑
摘要:/** 下划线转驼峰 */ var formatToHump = (value) => value.split('_').map((letter, i) => letter.split('').map((w,j)=>(i&&!j)?w.toUpperCase():w.toLowerCase()).j 阅读全文
posted @ 2023-01-30 11:47 不邪 阅读(27) 评论(0) 推荐(0) 编辑
摘要:es2015 ECMAScript 6(以下简称ES6)是JavaScript语言的下一代标准。因为当前版本的ES6是在2015年发布的,所以又称ECMAScript 2015。也就是说,ES6就是ES2015。 说明:此文章根据《实战ES2015:深入现代JavaScript+应用开发》这本书做的 阅读全文
posted @ 2022-08-29 14:39 不邪 阅读(25) 评论(0) 推荐(0) 编辑
摘要:方法1: // data:指待读取blob数据 let reader = new FileReader(); reader.onload = event => { //读取之后进行操作的代码区域,event.currentTarget.result 指读取到的内容 console.log(event 阅读全文
posted @ 2022-08-16 10:04 不邪 阅读(3592) 评论(0) 推荐(0) 编辑
摘要:vscode 插件 koroFileHeader 详细配置 阅读全文
posted @ 2021-12-20 09:08 不邪 阅读(10159) 评论(0) 推荐(3) 编辑
摘要:前端开发中,MVC,MVP和MVVM都是常见的软件架构设计模式(Architectural Pattern)。vue就是采用MVVM的渐进式JavaScript框架。本文以vue为例,说明部分业务场景下使用开发方案需考虑的问题 阅读全文
posted @ 2020-05-29 16:07 不邪 阅读(156) 评论(0) 推荐(0) 编辑
摘要:iframe 页面跳转 阅读全文
posted @ 2020-04-03 15:07 不邪 阅读(267) 评论(0) 推荐(0) 编辑
摘要:function isHas(obj, key, str) { const keyArr = obj.split('.'); let i = 0; const is = (isObj, isKey) => isObj ? is(isObj[isKey], keyArr[++i]) : str; co 阅读全文
posted @ 2019-07-22 09:07 不邪 阅读(799) 评论(0) 推荐(0) 编辑
摘要:克隆远程分支到本地 git clone <https://github.com/cqzyl/methods.js.git> 进入master分支 git checkout master 以master为源创建本地分支test git checkout -b test 将本地test分支作为远程tes 阅读全文
posted @ 2019-06-18 16:28 不邪 阅读(215) 评论(0) 推荐(0) 编辑
摘要:按位操作符(Bitwise operators) 将其操作数(operands)当作32位的比特序列(由0和1组成),而不是十进制、十六进制或八进制数值。例如,十进制数9,用二进制表示则为1001。按位操作符操作数字的二进制形式,但是返回值依然是标准的JavaScript数值。 a|1 把这个数强行 阅读全文
posted @ 2018-07-25 14:27 不邪 阅读(3185) 评论(0) 推荐(0) 编辑
摘要:位运算版本的交换两数 if(a !== b){ a = a^b; b = a^b; a = a^b; } console.log(a, b) 阅读全文
posted @ 2018-07-25 12:02 不邪 阅读(140) 评论(0) 推荐(0) 编辑
摘要:str.replace(/[^0-9]/ig, '') 阅读全文
posted @ 2018-06-21 16:35 不邪 阅读(221) 评论(0) 推荐(0) 编辑

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