You can use Array.filter:
...
events: <?= $response ?>.filter(function(x) { return x.status === "1";}),
...
If you do it this way (or the way you have it), make sure that the $ response variable always leads to an array, even if it is empty, or you will have headaches.
source
share