TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rameez Javed
NA
395
61.6k
Filter Array of Objects from Simple Array Javascript
Feb 26 2020 12:05 AM
Hi, How can i fitler array of objects from simple array. I've two array like below I want to get the array of object whose id is selected in simple array.
Array1 = [
"1223"
,
"2344"
,
"8775"
];
Array2 =[{ID: "1223", OrderNo:
"8"
, Name:
"Alex"
, DOB:
"02/24/1989"
}
{ID: "2443", OrderNo:
"7"
, Name:
"Jordan"
, DOB:
"02/20/2000"
}
{ID: "8775", OrderNo:
"6"
, Name:
"Michel"
, DOB:
"11/09/1877"
}
{ID: "2344", OrderNo:
"1"
, Name:
"Hallen"
, DOB:
"12/25/1887"
}]
I want to get the resulting array of object including the elements in Array1. dummy resulting array like below.
resultArray =[{ID:
"1223"
, OrderNo:
"8"
, Name:
"
Alex
"
, DOB:
"02/24/1989"
}
{ID:
"8775"
, OrderNo:
"6"
, Name:
"
Michel
"
, DOB:
"11/09/1877"
}
{ID:
"2344"
, OrderNo:
"1"
, Name:
"
Hallen
"
, DOB:
"12/25/1887"
}]
Reply
Answers (
3
)
Validating Dynamic Table Jquery
Katalon Recorder is better then Selenium IDE