JSFiddle - React, Tailwind, and code Playground

by Sajeetharan Sinnathurai

JavaScript

var events = [{"_id":"5890b4796166c457ffdee233","description":"Adele is coming home for the finale of her world tour. In June and July 2017 Adele will perform 360°, in-the-round, for four special evenings in London's iconic Wembley Stadium.\n\nFor more information visit https://live.adele.com.","end_time":"2017-07-02T23:00:00+0100","name":"Adele","place":{"name":"Wembley Stadium","location":{"city":"Wembley","country":"United States","latitude":51.556239704361,"longitude":-0.2796649891529,"zip":"HA9 0WS","_id":"58995d555369d607bcc40512"},"id":"135805543129024","_id":"5890b47a6166c457ffdee284"},"start_time":"2017-07-02T18:00:00+0100","id":"657337524435079","parent":[["Bke7J9QRPx"]]}
,{"_id":"5890b4796166c457ffdee245","description":"Delivery will be delayed until Oct 2, 2016.","name":"Adele","place":{"name":"American Airlines Center","location":{"city":"Dallas","country":"United States","latitude":32.790485550848,"longitude":-96.810278349053,"state":"TX","street":"2500 Victory Ave","zip":"75219","_id":"58995d555369d607bcc40514"},"id":"26606856232","_id":"5890b47b6166c457ffdee2e4"},"start_time":"2016-11-02T20:00:00-0500","id":"649884741817020"}];
var catid = ["Bke7J9QRPx"];
let eventsF = events.filter(book => book.parent && Array.isArray(book.parent) && book.parent.map(innerArray => innerArray.indexOf(catid) !== -1));

console.log(eventsF);