title: Checking for presence of array in parameters
body: <p>I am currently checking for an array in the parameters passed to a JavaScript function.
  The arguments can be of type:</p>
  
  <pre><code>1. function(a, b, c, d)
  2. function([a, b, c, d])
  3. function([a], b, c, [d, e, f], g)
  </code></pre>
  
  <p>I need to check if the parameters are contained in a single array or not. The following code works for case <code>1.</code> and <code>2.</code> but not for <code>3.</code> :</p>
  
  <pre><code>if (Array.isArray(args)){
    // section A
  }
  else{
    // section B
  }
  </code></pre>
  
  <p>This code is considering <code>3.</code> to be an array, though it has mixed values, it is entering section A instead of B. I want it to enter section B. Only arguments surrounded by <code>[]</code> completely should go in A.</p>