for in遍历(学习笔记)
来源:互联网 发布:删除excel中重复数据 编辑:程序博客网 时间:2024/05/16 17:05
for in 既可以遍历数组又可以遍历对象
typeShowClickEvent(index){ let typeName= this.state.typeNameList[index]; let obj = {}; if( typeName == "类型") { }else { obj.workOrderTypeString = typeName; } if( this.state.statusName == "状态" ) { }else { obj.workOrderStatusString = this.state.statusName; } if( this.state.city == "城市" ) { }else { obj.city = this.state.city; } let list = this.state.keepList; //for in 遍历对象 for(var x in obj) { // x 为对象的键,obj[x] 为键值 list = list.filter((item,index)=>{ //list 代表的是 代表一个数组 //item 代表数组中的每一项 ,是一个对象 //console.log("item",item); return item[x] == obj[x]; }) } if( list.length === 0){ this.props.history.push(`/noorder`); }else { this.setState({ type_show: false, typeName: typeName, contentList: list, }) }}
阅读全文
0 0
- for in遍历(学习笔记)
- for in遍历nodeList
- for...in遍历数组
- 快速遍历 for...in...
- 对象 遍历 ( for in )
- for in 遍历json
- Python学习笔记(2)-whil,for,for...in,循环嵌套
- 遍历json对象 for in
- for in循环遍历实例
- oc 中的 for in遍历
- 遍历、筛选for in / forEach()
- 小心FOR IN遍历数组
- 使用for in遍历数组
- javaScript JSON 遍历(for in)
- cocos-quick-lua学习笔记---遍历table(in pairs)
- ES6学习笔记(六)--set,map数据结构和for...of遍历
- lua学习笔记之再淡for语句的遍历
- PHP学习笔记——使用for循环遍历数组
- Largest prime factor(素数筛选法)
- Python图像处理的基本操作(一)
- java使用UDP协议进行服务器客户端通信
- poj 1703 Find them, Catch them(裸地种类并查集)
- Codeforces Round #442 (Div. 2) F. Ann and Books
- for in遍历(学习笔记)
- jmeter二次开发准备
- set集合去重
- MySQL limit
- 以图搜图BOF
- shell 脚本简介
- C++程序设计案例实训教程第1章
- path
- Python 编程进阶经典算法逻辑编程