<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/math.mode.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>math.mode</api:function-name><api:suggest>math.mode</api:suggest><api:suggest>math</api:suggest><api:suggest>mode</api:suggest><api:function-link mode="xquery" fullname="math:mode">/apidoc/8.0/math:mode.xml</api:function-link><api:function mode="javascript" name="mode" type="builtin" lib="math" category="MathBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="math" namespace="http://marklogic.com/xdmp/math" fullname="math.mode"><api:summary>
  <p xmlns="http://www.w3.org/1999/xhtml">
  Returns the mode of a sequence.  The mode is the value that occurs most
  frequently in a data set. If no value occurs more than once in the data
  set, the function returns the empty sequence. If the input is the empty
  sequence, the function returns the empty sequence.
  </p><p xmlns="http://www.w3.org/1999/xhtml">
  Note that a data set can have multiple “modes”. The order of multiple
  modes in the returned sequence is undefined.
  </p><p xmlns="http://www.w3.org/1999/xhtml">
  Also note that values from a lexicon lookup are repeated
  <code>cts:frequency</code> times before calculating the mode.
   </p><p xmlns="http://www.w3.org/1999/xhtml">
  The function can be used on numeric values, <code>xs:yearMonthDuration</code>,
  <code>xs:dayTimeDuration</code>, <code>xs:string</code>, 
  <code>xs:anyURI</code>, <code>xs:date</code>, 
  <code>xs:dateTime</code>, <code>xs:time</code>,
  and <code>cts:point</code>.
   </p>
</api:summary><api:params><api:param name="arg" type="xs:anyAtomicType*"><api:param-description>
  The sequence of values.
  </api:param-description><api:param-name>arg</api:param-name><api:param-type>(String | Number | Boolean | null)[]</api:param-type></api:param><api:param name="options" type="xs:string*" optional="true"><api:param-description>
    Options.  The default is ().
    <p xmlns="http://www.w3.org/1999/xhtml">
      Options include:</p>
      <blockquote xmlns="http://www.w3.org/1999/xhtml"><dl>
        <dt>"collation=<em>URI</em>"</dt>
        <dd>Applies only when $arg is of the xs:string type. If no specified,
        the default collation is used.</dd>
        <dt>"coordinate-system=<em>name</em>"</dt>
        <dd>Applies only when $arg is of the cts:point type. If no specified,
        the default coordinate system is used.</dd>
      </dl></blockquote>
  </api:param-description><api:param-name>options</api:param-name><api:param-type>String[]</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  math.mode([1,2,2,3,2,3,4,6,7,7,7])

  =&gt; 2 7
</pre></api:example></api:function></api:function-page>