In following snippet would like to access value from outside of function and class
  driver.wait(until.elementLocated(By.xpath(path)), 2000).
        then(text => {
               text.getText().then(value => {
                        console.log("value:: " + value);
                     })
Would like to access value from outside the function and class
 
    