code: public Object eval(String javascriptFunction) {
          try {
              JavascriptExecutor js = (JavascriptExecutor) driver;
              return js.executeScript(javascriptFunction);
          } catch (NoSuchMethodError | Exception e) {
              log.warn(e);
              return null;
          }
      }
docs: Executes a provided script, and returns the output of that script. If
  there is an error executing this script, a null value will be returned.
  
  @param javascriptFunction - the javascript function that is going to be executed
  @return Object: any resultant output from the javascript command