title: Protractor how to get/use the values for one variable from other function
body: <pre><code>  it('Check the row count', function () {
     
         module.verifyTableTitle().getText().then(function (Title) {
              expect(Title).toBe('ABC');
            module.verifyexcel().isPresent().then(function (firstExcel) {
                
          downloadex.verifyExcel('Excel1.xlsx'); 
  **console.log(&quot;rowcount :&quot;+rowObject1&quot;);**
  }
  
  
    this.verifyExcel = function (filename) {
          let workbook = new Excel.Workbook();
          browser.driver.wait(function () {
              return files.existsSync(downloadDirectory + '\\' + filename);
          }, 3000).then(function rowExcel() {
              switch (filename) {
                  case 'Excel1.xlsx'':
              let worksheet = workbook.getWorksheet(&quot;Excel1&quot;);
                          let rowObject1 = worksheet.rowCount;
                          console.log(&quot;rowcount :&quot;+rowObject1);
     });
      return rowObject1;
         });
         break;
  </code></pre>
  <p>how to get the rowcount of excel sheet from verifyExcel function(console.log(&quot;rowcount :&quot;+rowObject1)) to  top function.</p>