title: How to check a length of array in Karate framework?
body: <p>I have 2 different response from the REST Api as below</p>
  
  <pre><code>1. {"type":null,"title":"Request is invalid","status":"BAD_REQUEST","detail":"Please correct request and try again.","invalidParams":[{"name":"create.arg0.name","reason":"Name is required"}]}
  
  2. {"type":null,"title":"Unicode char u0000 is not allowed","status":"BAD_REQUEST","detail":"Unicode char u0000 is not allowed"}
  </code></pre>
  
  <p>I wanna write a condtion where if <code>invalidParams</code> present in respose, then compare the contents of array. If not, <code>invalidParams</code> should be null/undefined.</p>
  
  <pre><code> Scenario Outline: Create Asset Model with missing name and status
      Given url modelsUrl
      And request somedata
      When method POST
      Then status 400
      Then assert response.type == null
      Then match response.status == 'BAD_REQUEST'
      Then match (response.invalidParams != undefined &amp;&amp; response.invalidParams[0].reason contains &lt;reason&gt;) OR (response.invalidParams == undefined)
  </code></pre>
  
  <p>But comparing against null/undefied &amp; length also not working. How to handle this scenario in Karate? Normal Javascript is not working.</p>