
Javascript
米米太阳花
这个作者很懒,什么都没留下…
展开
-
遇到的js问题
1.属性名是变量的处理方式1.添加一个新属性var obj = {}; obj[setAttrName] = 'Tom'原创 2020-09-19 08:48:24 · 162 阅读 · 0 评论 -
js中常用的方法
1.join(sep):将数组中的元素合并为一个字符串,以sep分割。数组=>字符串2.substring(start, end+1):提取字符串指定下标之间的字符串原创 2020-09-09 15:25:02 · 180 阅读 · 0 评论 -
ES6中的Class类
ES6中的Class类本质上就是一个函数,指向构造函数。console.log(typeof Person);//functionconsole.log(Person===Person.prototype.constructor);//true定义class Person{ constructor(name,age){ this.name = name; this.age=age; } say(){ return "我的名字叫原创 2020-09-09 08:51:46 · 133 阅读 · 0 评论