ES5对函数拓展了bind方法 作用:为函数绑定作用域(当函数执行的时候,改变函数的作用域,并传递参数) 目前为止改变作用域的方法|关键字: bind, call, apply, with, eval call与apply的区别 他们都是改变函数作用域的方法,都是在调用该方法的时候,执行函数并改变作 ...
分类:
移动开发 时间:
2020-06-09 12:53:36
阅读次数:
95
面向对象三大特性之继承 继承与__bases__ 继承是一种创建新类的方式,极大程度上规避了类与类之间代码重复的问题。 Ps:在Python中,是支持多继承的,即一个子类可以继承多个父类。这是其他大多数语言中所不支持的。父类也可以叫基类,超类子类也可以叫派生类实例名.__class__ 查看当前实例 ...
分类:
其他好文 时间:
2020-06-08 19:22:04
阅读次数:
62
1 用法如下: // 子组件 const ChildCmp =(props, ref) => { const [value, setValue] = useState(''); const click = useCallback(() => { console.log(value) }, [valu ...
分类:
其他好文 时间:
2020-06-08 19:04:23
阅读次数:
280
构造函数继承 1、子类通过apply方法或者call方法把this指向父类 js代码 function Parent(name, age) { this.name = name this.age = age } Parent.prototype.init = function(){ console. ...
分类:
其他好文 时间:
2020-06-08 16:14:44
阅读次数:
74
腾讯天气接口: 请求地址 https://wis.qq.com/weather/common 请求方式 get支持jsonp 参数 参数名 必选 类型 说明 source 是 string pc、xw weather_type 是 string forecast_1h 未来48小时 forecast ...
分类:
其他好文 时间:
2020-06-07 21:25:04
阅读次数:
328
// obj 目标对象 target 目标位置 function animate(obj, target, callback) { // 清除原先定时器 clearInterval(obj.timer); obj.timer = setInterval(function() { // 步长值写到定时 ...
分类:
其他好文 时间:
2020-06-07 19:14:31
阅读次数:
80
在postgres中,当max_connect设置过大,启动的时候会报错: FATAL: could not create semaphores: No space left on device 创建semaphores时空间参数不够,查询官网,有这么一段解释: HINT: This error d ...
分类:
数据库 时间:
2020-06-07 13:07:43
阅读次数:
98
【1】基础应用——单次调用const fs = require('fs');//Promise初始化为:等待状态 pendinglet promise = new Promise((resolve, reject) => {console.log('start...');//异步任务fs.readF... ...
分类:
其他好文 时间:
2020-06-07 11:14:04
阅读次数:
82
julia做科学计算不错,号称比C 和Fortran都快,语法有matlab和lisp风,也非常容易写。 julia和python交互很方便。所以用julia实现算法。用python做工程+胶水。 一、安装julia 用pill.py脚本一键安装管理julia 参考https://mirrors.b ...
分类:
编程语言 时间:
2020-06-06 11:24:42
阅读次数:
101
<body> <div style="width: 200px;height: 200px;hotpink;"></div> <script> const fn = function(a,b){ console.log(this.name + this.age + "是个大傻瓜" + a + b ) ...
分类:
其他好文 时间:
2020-06-06 10:54:35
阅读次数:
165