1 promise.then(function(value) { 2 // success 3 }, function(error) { 4 // failure 5 }); then本质上是一个函数,因为then存在于对象之中,所以又叫做方法。将then当做一个函数就ok了。 then有两个参数, ...
分类:
其他好文 时间:
2020-12-18 12:46:53
阅读次数:
3
1 type testName = 'lx' | 'bj' | 'cd' | 1; 2 3 function testFun(arg1: testName){ 4 5 } 6 testFun('lx'); //正确 7 testFun(1); //正确 8 testFun('ll'); //错误 ...
分类:
其他好文 时间:
2020-12-18 12:35:08
阅读次数:
2
1 let arr = ["I", "go", "home"]; 2 3 delete arr[1]; // remove "go" 4 5 alert( arr[1] ); // undefined 6 7 // now arr = ["I", , "home"]; 8 alert( arr.le ...
分类:
编程语言 时间:
2020-12-18 12:30:13
阅读次数:
2
css background属性连写 依次的顺序为: background:color img_url repeat position / size 颜色, 地址, 平铺, 位置/size ...
分类:
其他好文 时间:
2020-12-18 12:25:39
阅读次数:
3
P1873 砍树 设置 一个判断条件的函数C(x),返回在砍树高度为x时能否得到足够木材.这是很简单的. bool C(long long x){ long long sum = 0; for(int i = 0; i < n; i++) if(s[i] > x) sum += s[i] - x; ...
分类:
其他好文 时间:
2020-12-18 12:24:51
阅读次数:
3
本节实现WIFI的连接,本节的例程可参考后面的TCP CLIENT或者TCP SERVER 的相关例程 TCP CLIENT地址: https://github.com/SmartArduino/Doiting_BL/tree/master/examples/WIFI_CLIENT WIFI_CLI ...
分类:
其他好文 时间:
2020-12-17 13:01:07
阅读次数:
3
{ checkbox: true, visible: true, formatter: function (value, row, index) { if(row.isCheck =="1"){ return {disabled : true,} }else{ return {disabled : ...
分类:
其他好文 时间:
2020-12-17 12:54:44
阅读次数:
3
//暴力法 时间复杂度 O(m * n) //根据排序的规律观察,得到类似2叉搜索树的解法 O(m + n) class Solution { public boolean findNumberIn2DArray(int[][] matrix, int target) { //判空 if(matri ...
分类:
编程语言 时间:
2020-12-17 12:41:42
阅读次数:
1
java.util.iterator接口(迭代器) 概述:对集合进行遍历,Iterator迭代器是一个接口,我们无法直接使用,需要使用Iterator接口的实现类对象。 获取实现欸的方式比较特殊。 Collection接口中有一个方法,叫iterator(),这个方法返回的就是迭代器的实现类对象 I ...
分类:
其他好文 时间:
2020-12-17 12:31:13
阅读次数:
2
前言 开发中很多地方都会遇到密码输入,这时候往往需要根据UI设计自定义。这里遵守UIKeyInput,实现协议中的方法,让自定义View可以进行文字输入;再通过func draw(_ rect: CGRect)绘制现自定义UI;使用配置类来统一接口;使用代理来管理各种输入相关的事件。文章末尾有提供O ...
分类:
移动开发 时间:
2020-12-17 12:12:48
阅读次数:
3