title: Why does Array.prototype.every return true on an empty array?
body: <pre><code>[].every(i =&gt; i instanceof Node) // -&gt; true
  </code></pre>
  
  <p>Why does the every method on arrays in JavaScript return true when the array is empty. I'm trying to do type assertion like so...</p>
  
  <pre><code>const isT = (val, str) =&gt; typeof val === str
  const nT = (val, str) =&gt; !isT(val, str)
  const is = {}
  
  is.Undef = (...args) =&gt; args.every(o =&gt; isT(o, 'undefined'))
  is.Def = (...args) =&gt; args.every(o =&gt; nT(o, 'undefined'))
  is.Null = (...args) =&gt; args.every(o =&gt; o === null)
  is.Node = (...args) =&gt; args.every(o =&gt; o instanceof Node)
  is.NodeList = (...args) =&gt; args.every(n =&gt; n instanceof NodeList)
  </code></pre>
  
  <p>but these still return true even when no arguments are passed to them.</p>