Combining multiple filters defined using Filter

I have two filters f1 and f2 defined using Filter as follows:

f1 ='start', prevMonth)
f2 ='start', endDate)

How can I combine f1 and f2 to get the equivalent of f1 AND f2:'start', prevMonth)'start', endDate)

One way to do this is:

`f1.toString() + " && " + f2.toString()`

But I was wondering if there is a more elegant way (i.e. using Filter methods).

You could use the Filter#lit method (“lit” as in “literal”) and pass a Filter object:

f1 ='start', prevMonth);
f2 ='start', endDate);

// v7.9 and later

// v7.8 and below
f1.and.lit(f2); // Beware: mutates f1
Filter.lit(f1).and.lit(f2); // does not mutate either f1 or f2