<commit_before>---
id: index
title: lodash
description: A JavaScript utility library delivering consistency, modularity, performance, &amp; extras.
---
  <hgroup>
   <h1>lodash <span>v3.9.3</span></h1>
   <h2 class="description">A JavaScript utility library delivering consistency, <a href="https://www.npmjs.com/browse/keyword/lodash-modularized">modularity</a>, <!--<a href="/benchmarks">-->performance<!--</a>-->, &amp; <a href="#features">extras</a>.</h2>
  </hgroup>

  <pre class="intro"><code>_.<span class="me1">assign</span><span class="br0">&#40;</span><span class="br0">&#123;</span> <span class="st0">'a'</span><span class="sy0">:</span> <span class="nu0">1</span> <span class="br0">&#125;</span><span class="sy0">,</span> <span class="br0">&#123;</span> <span class="st0">'b'</span><span class="sy0">:</span> <span class="nu0">2</span> <span class="br0">&#125;</span><span class="sy0">,</span> <span class="br0">&#123;</span> <span class="st0">'c'</span><span class="sy0">:</span> <span class="nu0">3</span> <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br><span class="co1">// → { 'a': 1, 'b': 2, 'c': 3 }</span><br>_.<span class="me1">map</span><span class="br0">&#40;</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="sy0">,</span> <span class="nu0">2</span><span class="sy0">,</span> <span class="nu0">3</span><span class="br0">&#93;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>n<span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="kw1">return</span> n <span class="sy0">*</span> <span class="nu0">3</span><span class="sy0">;</span> <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br><span class="co1">// → [3, 6, 9]</span></code></pre>
  <p id="social"><iframe style="width:95px;height:25px" allowtransparency frameborder="0" scrolling="no" src="/github-btn.html?user=lodash&amp;repo=lodash&amp;count=true&amp;type=watch"></iframe><iframe style="width:95px; height:25px" allowtransparency frameborder="0" scrolling="no" src="/github-btn.html?user=lodash&amp;repo=lodash&amp;count=true&amp;type=fork"></iframe></p>

  <h2 id="docs">Documentation</h2>
  <ul>
   <li><a href="/docs">API Documentation</a></li>
   <li><a href="http://devdocs.io/lodash/">DevDocs – <em>a searchable interface for our documentation</em></a></li>
  </ul>

  <h2 id="download">Download</h2>
  <p>Review the <a href="https://github.com/lodash/lodash/wiki/build-differences">build differences</a> &amp; pick the one that’s right for you.</p>
  <ul class="multiline-items">
   <li><a href="https://raw.github.com/lodash/lodash/3.9.3/lodash.js">Modern build</a> (<a href="https://raw.github.com/lodash/lodash/3.9.3/lodash.min.js">minified</a>)<br>For new environments like Chrome, Firefox, IE ≥ 9, &amp; Safari ≥ 5.1</li>
   <li><a href="https://raw.github.com/lodash/lodash-compat/3.9.3/lodash.js">Compatibility build</a> (<a href="https://raw.github.com/lodash/lodash-compat/3.9.3/lodash.min.js">minified</a>)<br>For new &amp; old environments like IE ≤ 8 &amp; PhantomJS</li>
  </ul>

  <h2 id="formats">Module formats</h2>
  <p>lodash is also available in a variety of other builds &amp; module formats.</p>
  <ul>
   <li>npm packages for <a href="https://www.npmjs.com/package/lodash">modern</a>, <a href="https://www.npmjs.com/package/lodash-compat">compatibility</a>, &amp; <a href="https://www.npmjs.com/browse/keyword/lodash-modularized">per method</a> builds</li>
   <li>AMD modules for <a href="https://github.com/lodash/lodash/tree/3.9.3-amd">modern</a> &amp; <a href="https://github.com/lodash/lodash-compat/tree/3.9.3-amd">compatibility</a> builds</li>
   <li>ES modules for the <a href="https://github.com/lodash/lodash/tree/3.9.3-es">modern</a> build</li>
  </ul>

  <p>CDN copies are available on <a href="https://cdnjs.com/">cdnjs</a> &amp; <a href="http://www.jsdelivr.com/">jsDelivr</a>.<br>Create <a href="/custom-builds">custom builds</a> with only the features you need.<br>Looking for more functional usage? Try <a href="https://www.npmjs.com/package/lodash-fp">lodash-fp</a>.</p>

  <h2 id="reference">Dive in</h2>
  <p>Check out our <!--<a href="/tests">unit tests</a>, <a href="/benchmarks">benchmarks</a>, --><a href="https://github.com/lodash/lodash/wiki/Changelog">changelog</a>, <a href="https://github.com/lodash/lodash/wiki/Roadmap">roadmap</a>, as well as <a href="https://github.com/lodash/lodash/wiki/Resources">community created podcasts, posts, &amp; videos</a>.</p>

  <h2 id="installation">Installation</h2>
  <p>In a browser:</p>
  <pre><code><span class="sy0">&lt;</span>script src<span class="sy0">=</span><span class="st0">&quot;lodash.js&quot;</span><span class="sy0">&gt;&lt;/</span>script<span class="sy0">&gt;</span></code></pre>
  <p>In an AMD loader:</p><commit_msg>10k stars don't fit<commit_after>---
id: index
title: lodash
description: A JavaScript utility library delivering consistency, modularity, performance, &amp; extras.
---
  <hgroup>
   <h1>lodash <span>v3.9.3</span></h1>
   <h2 class="description">A JavaScript utility library delivering consistency, <a href="https://www.npmjs.com/browse/keyword/lodash-modularized">modularity</a>, <!--<a href="/benchmarks">-->performance<!--</a>-->, &amp; <a href="#features">extras</a>.</h2>
  </hgroup>

  <pre class="intro"><code>_.<span class="me1">assign</span><span class="br0">&#40;</span><span class="br0">&#123;</span> <span class="st0">'a'</span><span class="sy0">:</span> <span class="nu0">1</span> <span class="br0">&#125;</span><span class="sy0">,</span> <span class="br0">&#123;</span> <span class="st0">'b'</span><span class="sy0">:</span> <span class="nu0">2</span> <span class="br0">&#125;</span><span class="sy0">,</span> <span class="br0">&#123;</span> <span class="st0">'c'</span><span class="sy0">:</span> <span class="nu0">3</span> <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br><span class="co1">// → { 'a': 1, 'b': 2, 'c': 3 }</span><br>_.<span class="me1">map</span><span class="br0">&#40;</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="sy0">,</span> <span class="nu0">2</span><span class="sy0">,</span> <span class="nu0">3</span><span class="br0">&#93;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>n<span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="kw1">return</span> n <span class="sy0">*</span> <span class="nu0">3</span><span class="sy0">;</span> <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br><span class="co1">// → [3, 6, 9]</span></code></pre>
  <p id="social"><iframe style="width:105px;height:25px" allowtransparency frameborder="0" scrolling="no" src="/github-btn.html?user=lodash&amp;repo=lodash&amp;count=true&amp;type=watch"></iframe><iframe style="width:95px; height:25px" allowtransparency frameborder="0" scrolling="no" src="/github-btn.html?user=lodash&amp;repo=lodash&amp;count=true&amp;type=fork"></iframe></p>

  <h2 id="docs">Documentation</h2>
  <ul>
   <li><a href="/docs">API Documentation</a></li>
   <li><a href="http://devdocs.io/lodash/">DevDocs – <em>a searchable interface for our documentation</em></a></li>
  </ul>

  <h2 id="download">Download</h2>
  <p>Review the <a href="https://github.com/lodash/lodash/wiki/build-differences">build differences</a> &amp; pick the one that’s right for you.</p>
  <ul class="multiline-items">
   <li><a href="https://raw.github.com/lodash/lodash/3.9.3/lodash.js">Modern build</a> (<a href="https://raw.github.com/lodash/lodash/3.9.3/lodash.min.js">minified</a>)<br>For new environments like Chrome, Firefox, IE ≥ 9, &amp; Safari ≥ 5.1</li>
   <li><a href="https://raw.github.com/lodash/lodash-compat/3.9.3/lodash.js">Compatibility build</a> (<a href="https://raw.github.com/lodash/lodash-compat/3.9.3/lodash.min.js">minified</a>)<br>For new &amp; old environments like IE ≤ 8 &amp; PhantomJS</li>
  </ul>

  <h2 id="formats">Module formats</h2>
  <p>lodash is also available in a variety of other builds &amp; module formats.</p>
  <ul>
   <li>npm packages for <a href="https://www.npmjs.com/package/lodash">modern</a>, <a href="https://www.npmjs.com/package/lodash-compat">compatibility</a>, &amp; <a href="https://www.npmjs.com/browse/keyword/lodash-modularized">per method</a> builds</li>
   <li>AMD modules for <a href="https://github.com/lodash/lodash/tree/3.9.3-amd">modern</a> &amp; <a href="https://github.com/lodash/lodash-compat/tree/3.9.3-amd">compatibility</a> builds</li>
   <li>ES modules for the <a href="https://github.com/lodash/lodash/tree/3.9.3-es">modern</a> build</li>
  </ul>

  <p>CDN copies are available on <a href="https://cdnjs.com/">cdnjs</a> &amp; <a href="http://www.jsdelivr.com/">jsDelivr</a>.<br>Create <a href="/custom-builds">custom builds</a> with only the features you need.<br>Looking for more functional usage? Try <a href="https://www.npmjs.com/package/lodash-fp">lodash-fp</a>.</p>

  <h2 id="reference">Dive in</h2>
  <p>Check out our <!--<a href="/tests">unit tests</a>, <a href="/benchmarks">benchmarks</a>, --><a href="https://github.com/lodash/lodash/wiki/Changelog">changelog</a>, <a href="https://github.com/lodash/lodash/wiki/Roadmap">roadmap</a>, as well as <a href="https://github.com/lodash/lodash/wiki/Resources">community created podcasts, posts, &amp; videos</a>.</p>

  <h2 id="installation">Installation</h2>
  <p>In a browser:</p>
  <pre><code><span class="sy0">&lt;</span>script src<span class="sy0">=</span><span class="st0">&quot;lodash.js&quot;</span><span class="sy0">&gt;&lt;/</span>script<span class="sy0">&gt;</span></code></pre>
  <p>In an AMD loader:</p>
{'fraction_non_alphanumeric': 0.25426847970555155, 'fraction_numerical': 0.03179633984255189, 'mean_word_length': 5.977175463623396, 'pattern_counts': {'":': 0, '<': 451, '<?xml version=': 0, '>': 451, 'https://': 34, 'lorem ipsum': 0, 'www.': 12, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5659095', 'n_tokens_mistral': 3882, 'n_tokens_neox': 3618, 'n_words': 610}