![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javascript
努力的choco
这个作者很懒,什么都没留下…
展开
-
es5 笔记
箭头函数 语法 类型 函数名 = (参数) => {函数块} let fn var const example let fn = (num1,num2)=>{ return num1+num2; } 一个参数时可不写参数括号 一个返回值时可不写花括号 example let fn = num => num*2...原创 2019-04-12 09:50:31 · 126 阅读 · 0 评论 -
es6 面向对象
原来的写法 function user(name,pass){ //注意均不能使用箭头函数 this.name = name; this.pass = pass; } user.prototype.showName = function(){ //注意均不能使用箭头函数 alert(this....原创 2019-04-12 16:31:20 · 103 阅读 · 0 评论