title: Test failing with " testRegistration.forEach is not a function "
body: <p>I am getting below error in cypress for the below test. I am not familiar with JS and Cypress.Is there any mistake in the code?</p>
  <p>*The following error originated from your test code, not from Cypress.</p>
  <blockquote>
  <p>testRegistration.forEach is not a function*</p>
  </blockquote>
  <pre><code>export const testRegistration = ({firstName, lastName, email, password, confirmPassword}) ={
  
    cy.get('input[name=&quot;firstName&quot;]').type(firstName)
  
    cy.get('input[name=&quot;lastName&quot;]').type(lastName)
    
    cy.get('input[name=&quot;email&quot;]').type(email)
   
  
    cy.get('input[name=&quot;password&quot;]').type(password)
  
    cy.get('input[name=&quot;confirmPassword&quot;]').type(confirmPassword)
  
    return cy.contains('button', 'Register').click()
  
  }
  </code></pre>
  <p>I am trying to shorten the above code with foreach ,</p>
  <pre><code>export const testRegistration = ({firstName, lastName, email, password, confirmPassword}) =&gt; {
        
    return cy.contains('button', 'Register').click()
          
  }
  
  testRegistration.forEach(function (argument, index) {
  
    cy.get(`input[name= &quot;${argument}&quot;]`).type(argument);
  
  });
  </code></pre>