Categories: Stamps

Underscore.js

Published by
Join Lenon Blur
Video _.some

Underscore is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. It’s the answer to the question: “If I sit down in front of a blank HTML page, and want to start being productive immediately, what do I need?” … and the tie to go along with jQuery’s tux and Backbone’s suspenders.

Underscore provides over 100 functions that support both your favorite workaday functional helpers: map, filter, invoke — as well as more specialized goodies: function binding, javascript templating, creating quick indexes, deep equality testing, and so on.

A complete Test Suite is included for your perusal.

You may also read through the annotated source code. There is a modular version with clickable import references as well.

You may choose between monolithic and modular imports. There is a quick summary of the options below, as well as a more comprehensive discussion in the article.

Enjoying Underscore, and want to turn it up to 11? Try Underscore-contrib.

The project is hosted on GitHub. You can report bugs and discuss features on the issues page or chat in the Gitter channel.

You can support the project by donating on Patreon. Enterprise coverage is available as part of the Tidelift Subscription.

Underscore is an open-source component of DocumentCloud.

v1.13.6 Downloads (Right-click, and use “Save As”)

ESM (Development) 65.9 KB, Uncompressed with Plentiful Comments (Source Map) ESM (Production) 8.59 KB, Minified and Gzipped (Source Map) UMD (Development) 68.4 KB, Uncompressed with Bountiful Comments (Source Map) UMD (Production) 7.48 KB, Minified and Gzipped (Source Map) Edge ESM Unreleased, current master, use by your own judgement and at your own risk Edge UMD Unreleased, current master, use if you’re feeling lucky

v1.13.6 CDN URLs (Use with <script src=”…”></script>)

  • https://cdn.jsdelivr.net/npm/[email protected]/underscore-umd-min.js
  • https://cdn.jsdelivr.net/npm/[email protected]/underscore-esm-min.js
  • https://unpkg.com/[email protected]/underscore-umd-min.js
  • https://unpkg.com/[email protected]/underscore-esm-min.js
  • https://pagecdn.io/lib/underscore/1.13.6/underscore-umd-min.js
  • https://pagecdn.io/lib/underscore/1.13.6/underscore-esm-min.js
  • https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.6/underscore-umd-min.js
  • https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.6/underscore-esm-min.js

In most cases, you can replace the version number above by latest so that your embed will automatically use the latest version, or stable if you want to delay updating until an update has proven to be free of accidental breaking changes. Example:https://cdn.jsdelivr.net/npm/underscore@latest/underscore-umd-min.js

Package Installation

  • Node.js npm install underscore
  • Meteor.js meteor add underscore
  • Bower bower install underscore

If you are hardcoding the path to the file within the package and you are unsure which build to use, it is very likely that you need underscore-umd.js or the minified variant underscore-umd-min.js.

Monolithic Import (recommended)

  • ESM import _, { map } from ‘underscore’;
  • AMD require([‘underscore’], …)
  • CommonJS var _ = require(‘underscore’);
  • ExtendScript #include “underscore-umd.js”

Modular Import

  • ESM import map from ‘underscore/modules/map.js’
  • AMD require([‘underscore/amd/map.js’], …)
  • CommonJS var map = require(‘underscore/cjs/map.js’);

For functions with multiple aliases, the file name of the module is always the first name that appears in the documentation. For example, _.reduce/_.inject/_.foldl is exported from underscore/modules/reduce.js. Modular usage is mostly recommended for creating a customized build of Underscore.

Engine Compatibility

Underscore 1.x is backwards compatible with any engine that fully supports ES3, while also utilizing newer features when available, such as Object.keys, typed arrays and ES modules. We routinely run our unittests against the JavaScript engines listed below:

  • Chrome 26-latest
  • Edge 13, 18 and latest
  • Firefox 11-latest
  • Internet Explorer 9-11
  • Node.js 8-latest LTS
  • Safari 8-latest

In addition:

  • We have recent confirmation that the library is compatible with Adobe ExtendScript.
  • There is support code present for IE 8, which we will retain in future Underscore 1.x updates.
  • Patches to enhance support for other ES3-compatible environments are always welcome.

Underscore 2.x will likely remove support for some outdated environments.

This post was last modified on 27/10/2023 5:44 am

Join Lenon Blur

I am a JOIN LENON BLUR - world-leading expert, and I am the admin of Antiqueworld with many years of experience researching antiques and postal publications. I hope to provide the audience with the most accurate and informative information.

Share
Published by
Join Lenon Blur

Recent Posts

How to Buy Postage Online

When it comes to buying postage online, the benefits are pretty straightforward: you save time,…

6 months ago

14 USPS Stamp Types (Your Complete Guide)

One of the most prominent hobbies in the world is collecting stamps, otherwise known as…

6 months ago

Types of Rubber Stamps

There are various types and options of rubber stamps, so it is quite natural to…

6 months ago

First-Class Mail Fact Sheet

First-Class Mail Fact Sheet What is First-Class Mail Shape-Based Pricing? First-Class Mail shape-based pricing aligns…

6 months ago

Can You Buy One Stamp At USPS? (All You Need to Know)

When you’re sending someone a letter or a card, all you need is one Forever…

7 months ago

USP 51 Antimicrobial Effectiveness Test

USP <51> is used to test preservative effectiveness. The number “<51>” refers to General Chapter…

7 months ago