title: What does ‘::’ (double colon) do in JavaScript?
body: <p>The documentation of some JavaScript APIs shows the following snippets as an example of how to invoke some function:</p>
  
  <pre><code>&lt;button type="button" onClick="foo.DoIt(72930)"&gt;Click&lt;/button&gt;
  
  &lt;button type="button" onClick="foo.DoIt(42342::37438)"&gt;Click&lt;/button&gt;
  </code></pre>
  
  <p><code>::</code> is obviously used here to allow either one or two arguments to be passed to the function.</p>
  
  <p><strong>What does <code>::</code> do in JavaScript?</strong></p>
  
  <p>And how does the function know if one or two values were passed? How does it read them?</p>
  
  <hr>
  
  <p>On closer look, the examples show other weird stuff like</p>
  
  <pre><code>&lt;button type="button" onClick="foo.Bar(72//893)"&gt;Click&lt;/button&gt;
  
  &lt;button type="button" onClick="foo.Qux(425;1,34::)"&gt;Click&lt;/button&gt;
  </code></pre>
  
  <p>At least the <code>//</code> looks just wrong.</p>
  
  <p>So I guess it's not some fancy new syntax that I'm not aware of, but maybe the examples are just missing quotes around a single string argument.</p>