title: Assigning function to var does not work. Value is still 'undefined'
body: <p>I'm struggling with this problem since a while.
  I'm new in <strong>Javascript</strong>, so there are some things I still don't understand. 
  I created function <strong>linkBuilder</strong> to extract some data from a JSON file. I tested <strong>parseLine</strong> and it works.</p>
  
  <pre><code>links=[];
  let linkBuilder = function(){
    d3.text('prova2utenti.json',function(err,data){
    if (err) throw err;
    var elements = data.split('\n');
    for (var i=0, l=elements.length; i&lt;l; i++){
      links.concat(parseLine(elements[i]));
      console.log(links);
    }
    });
  }
  </code></pre>
  
  <p>The <strong><em>Problem</em></strong> is that when I try to create the links for my graph using this code:</p>
  
  <pre><code>links.forEach(function(link) {
    link.source = nodes[link.source] || (nodes[link.source] = {name: link.source});
    link.target = nodes[link.target] || (nodes[link.target] = {name: link.target});
  });
  </code></pre>
  
  <p>Nothing is shown on my web page, it is like the var <em>links</em> is never initialized. I suppose this is because of the <strong>hoisting</strong>, but I'm not sure and anyway I don't know how to solve.
  Any help is really appreciated.</p>