当前位置:网站首页>Handling abnormal data
Handling abnormal data
2022-06-12 08:36:00 【Month to month better】
According to the data returned by the back end , Filter out normal data , Get abnormal data display
The backend data is as follows :
let data = {
a: {
id: 1,
result: {
status: "error",
code: "HTTP_400",
message: "missing parameter"
}
},
b: {
id: 2,
result: {
status: "success",
code: "ok",
data: null
}
},
c: {
id: 3,
result: {
status: "success",
code: "ok",
data: null
}
}
};
The treatment is as follows :
function dealErrData(data) {
let keys = Object.keys(data);
let errData = [];
keys.forEach(item => {
if (data[item].result.code !== "ok") {
errData.push({
name: item, data: data[item] });
}
});
return errData;
}
console.log("errData:", dealErrData(data));

边栏推荐
- MPLS的原理与配置
- Code generation tool Autocode for XML Publishing
- Centso8 installing mysql8.0 (Part 2)
- Where does the driving force of MES system come from? What problems should be paid attention to in model selection?
- Engineers learn music theory (II) scale and tendency
- JVM learning notes: garbage collection mechanism
- At present, MES is widely used. Why are there few APS scheduling systems? Why?
- Gtest/gmock introduction and Practice
- 报错:文件夹在另一个程序中打开无法删除怎么办
- Hands on learning and deep learning -- a brief introduction to softmax regression
猜你喜欢

How to understand the production scheduling of APS system?

JVM学习笔记:垃圾回收机制
![[advanced pointer III] implement C language quick sorting function qsort & callback function](/img/f0/3729db83ba3eb15c7df0958858ece9.png)
[advanced pointer III] implement C language quick sorting function qsort & callback function

In the era of intelligent manufacturing, how do enterprises carry out digital transformation

ASP. Net project development practice introduction_ Item VI_ Error report (summary of difficult problems when writing the project)

Centos8 installing MySQL 8.0 (upper)

Where does the driving force of MES system come from? What problems should be paid attention to in model selection?

报错:文件夹在另一个程序中打开无法删除怎么办

What exactly is APS? You will know after reading the article

What is the MES system? What is the operation process of MES system?
随机推荐
Hands on deep learning -- concise implementation code of weight decay
[dynamic memory management] malloc & calloc and realloc and written test questions and flexible array
网站Colab与Kaggle
ctfshow web4
What is the difference between ERP production management and MES management system?
In depth interpretation of 5g key technologies
Engineers learn music theory (I) try to understand music
Production scheduling status of manufacturing enterprises and solutions of APS system
Build personal blog and web.
R loop assignment variable name
超全MES系统知识普及,必读此文
Query in MySQL
Ankerui fire emergency lighting and evacuation indication system
Knee joint
Code generation tool Autocode for XML Publishing
MSTP的配置与原理
Hands on learning and deep learning -- a brief introduction to softmax regression
2022.6.11-----leetcode. nine hundred and twenty-six
Triggers in MySQL
三国杀周边--------猪国杀题解