The parent data object of the JS array Object-The sub-array object, (subtraction of the array object)

Source: Internet
Author: User

<! DOCTYPE html>
<meta charset= "UTF-8" >
<title>Title</title>
<body>
<script>
var griddata_1=[{"name": "123", age:12},{"name": "124", age:13},{"name": "A", age:14}];
var edit_xiugai=[{"name": "123", age:12},{"name": "124", age:13}];
var arr_null=[];
for (Var arr_1=0;arr_1<griddata_1.length;arr_1++) {
var ss=true;
var aa=true;
for (Var arr_2=0;arr_2<edit_xiugai.length;arr_2++) {
if (Griddata_1[arr_1].name!=edit_xiugai[arr_2].name && griddata_1[arr_1].age!=edit_xiugai[arr_2].age& &aa==true) {
Ss=false;
}
else{
Ss=true;
Aa=false;
}
}
if (Ss==false) {
var pro_sum={name:griddata_1[arr_1].name,age:griddata_1[arr_1].age};
Arr_null.push (pro_sum);
}
}
Console.log (Arr_null);
</script>
</body>

The parent data object of the JS array Object-The sub-array object, (subtraction of the array object)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.