compare two array values and give common values

PHOTO EMBED

Mon Oct 09 2023 08:52:10 GMT+0000 (Coordinated Universal Time)

Saved by @rtrmukesh

let nextStatusIds = [37, 38];
let allowed_status = ['38', '36', '37'];

// Use the filter() method to get the included IDs
let includedIds = nextStatusIds.filter(id => allowed_status.includes(id.toString()));

console.log("Included IDs:", includedIds);
content_copyCOPY

https://chat.openai.com/