![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
干货
Meng飞
这个作者很懒,什么都没留下…
展开
-
JS Class类
JS Class类ES6提供了更接近传统语言的写法,引入了Class(类)这个概念,作为对象的模板。通过class关键字,可以定义类。//定义类class Point { constructor(x, y) { this.x = x; this.y = y; } toString() { return '(' + this.x + ', ' + this.y + ')'; }}上面代码定义了一个“类”,可以看到里面有一个constructor方法,原创 2020-06-05 15:21:49 · 261 阅读 · 0 评论 -
干货---mongodb访问受限问题及解决办法
问题一:mongodb访问受限:方法:设置mongod访问权限:mongod --bind_ip_all问题二:若访问不到新建的数据库,有可能是mongodb默认启动项的原因,方法:控制面板–管理工具–服务–MongoDb Server 关闭启动...原创 2019-02-27 19:11:59 · 664 阅读 · 0 评论 -
如何根据数组中每一项的某个非数字属性进行排序
根据数组中每一项的某个非数字属性进行排序话不多说,直接上代码:var arr = [ {name:'zhangsan',age:5}, {name:'lisi',age:23}, {name:'wangwu',age:8}];function compareFunction(property){ return function( a, b ){ ...原创 2019-08-17 16:51:41 · 928 阅读 · 0 评论