11 2020 档案

摘要:继承的实现 推荐组合继承(四)、寄生组合式继承(七)、ES6 继承(八) 一、原型链法(使用原型) 基本思想是利用原型让一个引用类型继承另一个引用类型的方法和实例。 代码如下 function staff(){ this.company = 'ABC'; } staff.prototype.comp 阅读全文
posted @ 2020-11-25 12:11 府谷市民小柴 阅读(225) 评论(0) 推荐(0) 编辑
摘要:基本类型:undefined,null,string,Number,Boolean,symbo(es6); 普通基本类型:undefined,null,symbo(es6); 特殊的基本包装类型:,string,Number,Boolean; 引用类型:Array,Object,Date,Funct 阅读全文
posted @ 2020-11-24 17:54 府谷市民小柴 阅读(59) 评论(0) 推荐(0) 编辑
摘要:1. css 一行文本超出... overflow: hidden; text-overflow:ellipsis; white-space: nowrap; 2.多行文本超出显示... display: -webkit-box; -webkit-box-orient: vertical; -web 阅读全文
posted @ 2020-11-24 12:25 府谷市民小柴 阅读(95) 评论(0) 推荐(0) 编辑
摘要:1、论如何优雅的取随机字符串(.substring() 的第二个参数控制取多少位 (最多可取13位)) Math.random().toString(16).substring(2) // 13位 Math.random().toString(36).substring(2) // 11位 2、论如 阅读全文
posted @ 2020-11-16 15:25 府谷市民小柴 阅读(77) 评论(0) 推荐(0) 编辑
摘要:js截取字符串 阅读全文
posted @ 2020-11-09 15:31 府谷市民小柴 阅读(2725) 评论(0) 推荐(0) 编辑
摘要:1、如何获取当前页面的滚动位置? const getScrollPosition = (el = window) => ({ x: el.pageXOffset !== undefined ? el.pageXOffset : el.scrollLeft, y: el.pageYOffset !== 阅读全文
posted @ 2020-11-05 15:58 府谷市民小柴 阅读(132) 评论(0) 推荐(0) 编辑

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