javascript typescript

Javascript 逻辑运算符 与 短路计算

 
 https://www.cnblogs.com/zztt/articles/4689542.html
 
https://blog.csdn.net/sinat_30443713/article/details/78657631
 
typescript
?:可选参数
 
优先级
https://www.jianshu.com/p/60c5d993b976
 

清空数组的一个有效方法,就是将length属性设为0。

var arr = [ 'a', 'b', 'c' ];

arr.length = 0;
arr // []


js一个数组中删除另一个数组的所有元素

var a = [{ id: 15 }, { id: -1 }, { id: 0 }, { id: 3 }, { id: 12.2 }];
var b = [15, 3];
a = a.filter(function (item) {

            return b.indexOf(item.id) < 0;

        })

console.log(a);
indexof不存在的元素小于零

 

原文地址:https://www.cnblogs.com/cschen588/p/12708729.html