function toThousands(num) { num = (num || 0).toString(); let number = 0, floatNum = '', intNum = ''; // 判断是否有小数位,有则截取小数点后的数字 if (num.indexOf('.') > 0) ...
分类:
Web程序 时间:
2020-07-10 14:51:25
阅读次数:
79
ylbtech-JavaScript-Runoob-JS函数:JavaScript 函数定义 1.返回顶部 1、 JavaScript 函数定义 JavaScript 使用关键字 function 定义函数。 函数可以通过声明定义,也可以是一个表达式。 函数声明 在之前的教程中,你已经了解了函数声明 ...
分类:
编程语言 时间:
2020-07-10 14:50:51
阅读次数:
54
function reduce(arr, callBack ,initVal){ if(!Array.isArray(arr) || !arr.length || typeof callBack != 'function') return []; let hasInitVal = initVal ! ...
分类:
其他好文 时间:
2020-07-10 13:39:11
阅读次数:
68
1、封装导出的方法 export function httpExport (url, params) { return new Promise((resolve, reject) => { axios({ url: url, method: 'post', data: params, respons ...
分类:
其他好文 时间:
2020-07-10 13:28:45
阅读次数:
103
let obj = { 0:"我是0", 1:"我是1", 2:"我是2", length:3, //添加[Symbol.iterator]方法 [Symbol.iterator] : function() { let _this = this; let index = 0; return { ne ...
分类:
其他好文 时间:
2020-07-10 13:18:16
阅读次数:
92
1, // 获取参数设置 app.get('/getPara', function(req, res) { // console.log(req.hostname); // console.log(req.params); // console.log(req.path); console.log( ...
分类:
Web程序 时间:
2020-07-10 12:59:36
阅读次数:
87
在触屏设备下,要判断是单指还是多指操作,可以通过event.touches数组对象的长度判断 例如: document.addEventListener('touchstart',function(event){ var touches = event.touches; if(touches.len ...
分类:
移动开发 时间:
2020-07-10 11:41:37
阅读次数:
129
在浏览器下编辑,习惯按住Ctrl+S键保存编辑内容。而网页的“ctrl + s”被默认为保存页面。 需要增加快捷保存方式 ctrl+s. $(window).keydown(function(event) { //alert( event.ctrlKey + ' ' + event.metaKey ...
分类:
其他好文 时间:
2020-07-10 11:39:44
阅读次数:
64
iview中使用datePicker实现选择月份范围,后端需要两个数据,开始月份与结束月份,如“2020-06”,“2020-07” ...
分类:
其他好文 时间:
2020-07-10 11:34:51
阅读次数:
171
Maximum Width of Binary Tree (M) 题目 Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maxim ...
分类:
其他好文 时间:
2020-07-10 10:11:00
阅读次数:
54