title: Javascript Function With Square Brackets
body: <p>I usually program in Python, but today I was trying to reverse engineer some Javascript code and I came across this line:</p>
  
  <pre><code>var ABC = DEF[XYZ];
  </code></pre>
  
  <p><code>DEF</code> is a <code>function</code> that was defined earlier. It takes one argument. <code>XYZ</code> is a <code>string</code> that was created earlier, and it contains the results of running <code>DEF</code> previously.</p>
  
  <p>I don't know much JavaScript, but it seems to me like it is defining a variable called <code>ABC</code> that contains the results of running function <code>DEF</code> with the argument <code>XYZ</code>. However, later on there is a line that goes <code>var GHI = ABC(JKL, DEF(MNO))</code> (<code>JKL</code> and <code>MNO</code> are both variables defined earlier). </p>
  
  <p>What puzzles me is that <code>ABC</code> was defined as a variable, not a function. So I'm thinking this has something to do with the square brackets seen earlier. </p>
  
  <p>So my question is: what is the purpose of those square brackets?</p>