title: Difficult to understand what exactly .has does with array in joi
body: <p>I was trying to learn JOI to validate a schema,I came across the following content</p>
  <pre><code>const schema = Joi.array().items(
    Joi.object({
      a: Joi.string(),
      b: Joi.number()
    })
  ).has(Joi.object({ a: Joi.string().valid('a'), b: Joi.number() }))
  </code></pre>
  <p>And I validated the scheme as follow <code>let c = arr2.validate([{ a:'a', b:'b'}])</code> the response I got on validation is</p>
  <pre><code>{
    value: [ { a: 'a', b: 'b' } ],
    error: [Error [ValidationError]: &quot;[0].b&quot; must be a number] {
      _original: [ [Object] ],
      details: [ [Object] ]
    }
  }
  </code></pre>
  <p>then I tried the above validation with the schema as follows</p>
  <pre><code>const arr2 = Joi.array().items(
    Joi.object({
      a: Joi.string(),
      b: Joi.number()
    })
  )
  </code></pre>
  <p>even now I got the following validation response</p>
  <pre><code>{
    value: [ { a: 'a', b: 'b' } ],
    error: [Error [ValidationError]: &quot;[0].b&quot; must be a number] {
      _original: [ [Object] ],
      details: [ [Object] ]
    }
  }
  </code></pre>
  <p>I'm just confused as to whats the use of .has in the first schema as I can have the valid value directly as below</p>
  <pre><code>const arr2 = Joi.array().items(
    Joi.object({
      a: Joi.string().valid('a'),
      b: Joi.number()
    })
  )
  </code></pre>
  <p>then what exact purpose is .has serving in the first schema</p>