Preview:
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);
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter