gpt4 book ai didi

javascript - 基于javascript中的另一个数组过滤数组

转载 作者:行者123 更新时间:2023-11-30 16:30:23 26 4
gpt4 key购买 nike

<分区>

我有两组数组,我想根据第二个数组过滤我的第一个数组并将值存储在第三个数组中

$scope.SaAssingTo = [
{ "PSAID": 1, "Name": "Ajay", "EMail": "ajay@cgi.com" },
{ "PSAID": 2, "Name": "pravin", "EMail": "ajay@cgi.com" },
{ "PSAID": 3, "Name": "anu", "EMail": "ajay@cgi.com" },
{ "PSAID": 4, "Name": "mohan", "EMail": "ajay@cgi.com" },
{ "PSAID": 5, "Name": "java", "EMail": "ajay@cgi.com" },
{ "PSAID": 6, "Name": "veenu", "EMail": "ajay@cgi.com" },
{ "PSAID": 7, "Name": "Ajay", "EMail": "ajay@cgi.com" },
{ "PSAID": 8, "Name": "pravin", "EMail": "ajay@cgi.com" },
{ "PSAID": 9, "Name": "anu", "EMail": "ajay@cgi.com" },
{ "PSAID": 10, "Name": "mohan", "EMail": "ajay@cgi.com" },
{ "PSAID": 11, "Name": "java", "EMail": "ajay@cgi.com" },
{ "PSAID": 6, "Name": "veenu", "EMail": "ajay@cgi.com" }
];
var filter array=[2,4,6,8];
var resultarray=[
{ "PSAID": 2, "Name": "pravin", "EMail": "ajay@cgi.com" }
{ "PSAID": 4, "Name": "mohan", "EMail": "ajay@cgi.com" },
{ "PSAID": 6, "Name": "veenu", "EMail": "ajay@cgi.com" },
{ "PSAID": 8, "Name": "pravin", "EMail": "ajay@cgi.com" },
];

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com