title: Dynamically chain methods to javascript function
body: <p>I am using Google's Firestore for searching a database, and the logic is to name your source, then chain where() methods for each variable.
  An example of working code is:</p>
  
  <pre><code>var ref = firebase.firestore().collection('myCol');
  ref.where('myVar1','==',true).where('myVar2','==',5).get()
  .then((results) =&gt; {...})
  </code></pre>
  
  <p>The problem I'm having is I have no idea how to dynamically attach those where() methods (as the number of them will change with each different search).
  I suspect if I knew the name of it I'd be able to find it, but dot functions didn't show up much... How could I do this?</p>