
javascript
10000cat
这个作者很懒,什么都没留下…
展开
-
js闭包closure
This feature—being able to reference a specific instance of a local binding in an enclosing scope—is called closure. A function that references bindings from local scopes around it is called a closure...原创 2018-11-30 14:01:18 · 116 阅读 · 0 评论 -
es6笔记
1.对象解析结构 // 首先有这么一个对象 const props = { className: 'tiger-button', loading: false, clicked: true, disabled: 'disabled' } 当我们想要取得其中的2个值:loading与clicked时: // es5 var loading = props.l...转载 2018-12-18 21:17:35 · 151 阅读 · 0 评论 -
mongoose返回值无法修改
mongoose 查询方法 find 例:db.collections.find(query,function(err,doc) { 如果var res = doc[0] 是{name:'feifei'} //假设只有一个元素 //此时你想给这个对象添加一个age属性 res.age = 16; 打印res 发现 没有age这个属性 这是因为doc[0]是一个b...转载 2018-12-19 11:31:58 · 603 阅读 · 0 评论