title: Global variable in nightwatch. Issue in for loop for node.js
body: <p>I am currently working with node + nightwatch + selenium for automation.
  I came across a scenario:</p>
  
  <p>I have defined an array as Global array in nightwatch:</p>
  
  <p>Dev.js</p>
  
  <pre><code>'checkforLink':{
      link1:"Some Xpath 1",
      link1:"Some Xpath 2",
      link1:"Some Xpath 3",
      link1:"Some Xpath 4"
  },
  </code></pre>
  
  <p>In my custom js  script in custom-commands, I am doing a <code>for</code> loop to fetch this links from global variable:</p>
  
  <pre><code>exports.command = function(callback) {
    browser = this;
  
    var data = browser.globals;
  
    console.log("Before all loop");
  
    for(var menu_link in data.checkforLink) {
      linkss1 = data.checkforLink.link1; // returns `Some Xpath 1`
      reqvar = data.mainMenuLink.menu_link; // Even though menu_link have value as link1, reqvar is undefined
      browser.click('######') // Click the path
    }
  
    return this;
  };
  </code></pre>