title: Returning Boolean from Cypress Page Object
body: <p>I'm trying to understand how do i return a boolean from cypress page object?</p>
  <p><strong>Use case:</strong></p>
  <blockquote>
  <p>I am trying to check if an element is present on the page. If so,
  return a boolean.</p>
  </blockquote>
  <p>Code:</p>
  <pre><code>class DataTable {
    constructor() {
       return this;
    }
  
    has(fieldName) {
      // HOW DO I RETURN A BOOLEAN HERE?
      return cy.get('.view-and-field-name').contains(fieldName)
    }
  }
  </code></pre>
  <p><strong>Mainpage.spec.js</strong></p>
  <pre><code>const dataTable = new DataTable();
  expect(dataTable.has(field.fieldName)).to.be.true;
  </code></pre>
  <p>I'd appreciate some insights on what I am doing wrong.</p>
  <p>Thank you for the time.</p>