code: def _are_js_vars_defined(browser, js_vars):
      
      # This script will evaluate to True iff all of
      # the required vars are defined.
      script = u" && ".join([
          u"!(typeof {0} === 'undefined')".format(var)
          for var in js_vars
      ])
  
      try:
          return browser.execute_script(u"return {}".format(script))
      except WebDriverException as exc:
          if "is not defined" in exc.msg or "is undefined" in exc.msg:
              return False
          else:
              raise
docs: Return a boolean indicating whether all the JavaScript
      variables `js_vars` are defined on the current page.
  
      `browser` is a Selenium webdriver instance.