const ids = [1, 4, 5],
data = {
records: [{
"empid": 1,
"fname": "X",
"lname": "Y"
}, {
"empid": 2,
"fname": "A",
"lname": "Y"
}, {
"empid": 3,
"fname": "B",
"lname": "Y"
}, {
"empid": 4,
"fname": "C",
"lname": "Y"
}, {
"empid": 5,
"fname": "C",
"lname": "Y"
}]
};
data.records = data.records.filter( i => ids.includes( i.empid ) );
console.info( data );