1

#yyds干货盘点# 【React工作记录五十九】根据key值过滤形成新得数组

 2 years ago
source link: https://blog.51cto.com/u_14476028/5399292
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

#yyds干货盘点# 【React工作记录五十九】根据key值过滤形成新得数组

原创

前端歌谣 2022-06-21 11:23:42 ©著作权

文章标签 数组 文章分类 JavaScript 前端开发 yyds干货盘点 阅读数153

我是歌谣 我有个兄弟 巅峰的时候排名c站总榜19 叫前端小歌谣 曾经我花了三年的时间创作了他 现在我要用五年的时间超越他 今天又是接近兄弟的一天人生难免坎坷 大不了从头再来 歌谣的意志是永恒的 放弃很容易 但是坚持一定很酷

根据key值过滤形成新得数组

#yyds干货盘点# 【React工作记录五十九】根据key值过滤形成新得数组_数组
编辑

 核心实现代码

var arr = [{ key: '', value: '所有' }];
orderStatusList &&
orderStatusList.map((item) => {
if (
item.key == '1202011271718478888579391' ||
item.key == '1202011271718328888637809' ||
item.key == '1202011271718158888762334' ||
item.key == '116345258629988888989281' ||
item.key == '1202011271719298888433205' ||
item.key == '1202011271718568888010433'
)
arr.push({
key: item.key,
value: item.value,
});
});

#yyds干货盘点# 【React工作记录五十九】根据key值过滤形成新得数组_数组_04

  • 1
  • 收藏
  • 评论
  • 分享
  • 举报

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK