Underscore.js _.VERSION Property

Beginner
5 min read
Updated: Nov 2026
5 examples
Utility

Definition

A string property that reports the current Underscore release (official Underscore docs). The docs sample is 1.13.8.

Pass the required arguments shown below. Underscore utility helpers usually return a new value or function — check edge cases before you ship.

Syntax

Read _.VERSION. Start with this line.

Underscore
_.VERSION (property) Official sample _.VERSION → 1.13.8
CallWhat it does
_.VERSION (property) Official sample _.VERSION → 1.13.8Version string property.

Load Underscore with import _ from "underscore" (or the UMD CDN build) so these helpers are available as _.

Library declarations
Underscore
_.VERSION (property) Official sample _.VERSION → 1.13.8

Parameters

ParameterDescription
_.VERSIONRequired. String naming the loaded release

Return Value

Return ValueDescription
*Semver-style string (e.g. "1.13.8")

Underscore.js Examples

Example 1 — Official Docs Sample

Read the loaded release string — the docs show 1.13.8.

Underscore
_.VERSION;
// → "1.13.8"
Try It Yourself

How It Works

  1. Load Underscore. These labs pin [email protected].
  2. Read the property. No call — just _.VERSION.
  3. Match docs. The string is "1.13.8", the official sample.
  4. Metadata only. It does not change helpers or behavior.

Example 2 — A String, Not a Function

Confirm the type, and contrast with a real method like _.template.

Underscore
typeof _.VERSION;                 // → "string"
typeof _.VERSION === "function";  // → false
typeof _.template;                // → "function"
Try It Yourself

How It Works

  1. Type. _.VERSION is a string property.
  2. Not callable. It is not a function — skip the parentheses.
  3. Contrast. _.template is a real method.
  4. Rule. Metadata vs API: read VERSION, call methods.

Example 3 — Semver Parts

Split on dots to get major, minor, and patch as separate pieces.

Underscore
var parts = _.VERSION.split(".");
parts[0];                 // → "1"
parts[1];                 // → "13"
parts[2];                 // → "8"
Number(parts[1]) >= 13;   // → true
Try It Yourself

How It Works

  1. Split. "1.13.8".split(".") → three string parts.
  2. Major / minor / patch. Indexes 0, 1, 2.
  3. Numeric compare. Use Number(…) before >=.
  4. Feature gates. Handy when you need “at least 1.13”.

Example 4 — Exact Build Match

String equality is safe when you care about one known pin.

Underscore
_.VERSION === "1.13.8";  // → true
_.VERSION === "1.13.7";  // → false
Try It Yourself

How It Works

  1. Pin. These labs load exactly 1.13.8.
  2. Match. Strict equality with that string is true.
  3. Mismatch. 1.13.7 is a different build → false.
  4. Use case. Assert the CDN/npm pin you expect in diagnostics.

Example 5 — String Compare Trap

Dictionary order is not semver — compare numeric parts instead.

Underscore
"1.9.0" > "1.13.8";
// → true  (wrong for semver — '9' > '1')

Number("1.9.0".split(".")[1]) > Number("1.13.8".split(".")[1]);
// → false  (correct: 9 is not greater than 13)

_.VERSION;
// → "1.13.8"
Try It Yourself

How It Works

  1. String >. Compares character by character — unsafe for versions.
  2. Why it lies. "9" beats "1" even though 1.9 < 1.13.
  3. Numeric parts. Split, convert, then compare.
  4. Loaded build. Last line prints the real _.VERSION.

Browser & Runtime Support

_.VERSION ships with Underscore.js (1.x). It runs anywhere Underscore runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install underscore.

✓ Stable · Underscore 1.x

_.VERSION

Available in [email protected] (UMD / ESM). The official docs sample is 1.13.8. Works in evergreen browsers and current Node LTS when Underscore is loaded.

100% With Underscore 1.x
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.VERSION Underscore 1.x+

Bottom line: Safe for production once Underscore is on the page or in your bundle. Not a native browser API — load Underscore first. Prefer a pinned CDN version (e.g. [email protected]).

Frequently Asked Questions

_.VERSION is a string property on the Underscore object that reports which release is loaded. The official docs sample is 1.13.8. It is metadata, not a function: read it, do not call it.
_.VERSION by itself. The docs show => 1.13.8, the version of the library those docs describe. A CDN pin such as [email protected] prints the same string.
No. It is a property. typeof _.VERSION is string. _.VERSION() throws because a string is not callable. Write _.VERSION with no parentheses.
No. Underscore sets it when the file loads. Reloading the page or swapping the script tag is how you pick up a different build.
Avoid it. Lexicographic compare is wrong for semver: '1.9.0' > '1.13.8' is true as strings because '9' > '1'. Split on dots and compare numbers, or test exact equality for one known build.
No. It is a stable Underscore property. The current docs and the 1.13.8 UMD build used in these labs both report 1.13.8.

Next: _.chain()

Wrap a value so Underscore methods can be chained until you call .value().

_.chain() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

9 people found this page helpful