title: How to solve ƒ Object() { [native code] } error while process word tokens?
body: <p>Consider an array of N items.</p>
  
  <pre><code>data = [
    {"source":"post","target":"incident"},
    {"source":"incident","target":"analysis"},
    {"source":"october","target":"post"},
    {"source":"mef","target":"composing"},
    {"source":"trend","target":"archive"},
    {"source":"object","target":"constructor"},
    {"source":"constructor","target":"parameter"}
  ]
  </code></pre>
  
  <p>I have a function that creates -based on this data- a matrix of nodes. Let's say:</p>
  
  <pre><code>[[0, 1, 0, 1, 0, 0, 0, 0, 0]
  [1, 0, 0, 0, 0, 0, 0, 0, 0]]
  </code></pre>
  
  <p>This function works fine with a given data. However, I noted that in this specific <em>sources</em> and <em>targets</em> it returns an error. The problem is the word: <code>constructor</code> in it. If I changed for example <strong>constructor</strong> to <strong>constructr</strong>, the functions will return the matrix.</p>
  
  <p>I found the problem in this part:</p>
  
  <pre><code>let nodes = {}
  data.map(link =&gt; {
    nodes[link.source] || (nodes[link.source] = 1)
    nodes[link.target] || (nodes[link.target] = 1)
  })
  nodes = d3.keys(nodes)
  nodes.sort()
  </code></pre>
  
  <p>After this process, <code>nodes</code> only contains this data: <code>["analysis", "archive", "composing", "incident", "mef", "object", "october", "parameter", "post", "trend"]</code> but constructor is missing.</p>
  
  <p>When I try to console some data: this specific node returns this: <code>ƒ Object() { [native code] }</code>.</p>
  
  <p>I fixed this issue converting each word in upper case <code>toUpperCase()</code>. However, I would like to know if there is other alternative to solve this.</p>
  
  <p>Thanks in advance.</p>