Lodash _.isSymbol() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Lang

Definition

Checks if value is classified as a Symbol primitive or Symbol object. Part of Lodash Lang since 4.0.0 (stable — not deprecated).

Note: Needs an ES2015+ runtime with Symbol. Well-known symbols like Symbol.iterator are real Symbols.

Syntax

Call _.isSymbol. Start with this line.

Lodash
_.isSymbol(value)
CallWhat it does
_.isSymbol(value)Primary signature.

Prefer import isSymbol from "lodash/isSymbol" when you want a smaller bundle.

Library declarations
Lodash
_.isSymbol(value)

Parameters

ParameterDescription
valueRequired. The value to check

Return Value

Return ValueDescription
*true if Symbol, else false

Lodash Examples

Example 1 — Official: Symbol.iterator

Well-known symbols are real Symbol primitives.

Lodash
_.isSymbol(Symbol.iterator);
// → true
Try It Yourself

How It Works

  1. Well-known. Symbol.iterator is a built-in Symbol.
  2. Type. typeof Symbol.iterator === "symbol".
  3. Result. Returns true.
  4. Use. Detect protocol keys before calling iterable APIs.

Example 2 — Official: String 'abc'

Ordinary text is not a Symbol.

Lodash
_.isSymbol('abc');
// → false
Try It Yourself

How It Works

  1. Input. Official sample: the string 'abc'.
  2. Wrong type. It is text, not a Symbol.
  3. Result. Returns false.
  4. Related. Use _.isString for strings.

Example 3 — Custom Symbol('id')

User-created Symbols pass the same way.

Lodash
var id = Symbol('id');

_.isSymbol(id);
// → true

Symbol('id') === Symbol('id');
// → false   // each call is unique
Try It Yourself

How It Works

  1. Create. Symbol('id') makes a new primitive.
  2. isSymbol. Classifies it as Symbol → true.
  3. Unique. Two calls with the same label are still different Symbols.
  4. Registry. Use Symbol.for when you need a shared global Symbol.

Example 4 — Boxed Symbol Object

Lodash also accepts Object(sym); typeof alone does not.

Lodash
var boxed = Object(Symbol('x'));

_.isSymbol(boxed);           // → true
typeof boxed === "symbol";   // → false  (typeof is "object")
Try It Yourself

How It Works

  1. Boxed. Object(Symbol(...)) wraps a Symbol.
  2. isSymbol. Sees the Symbol brand → true.
  3. typeof. Reports "object" → fails a naive check.
  4. Prefer. Use Symbol primitives in new code.

Example 5 — Common Non-Symbols

Values that often appear near keys but are not Symbols.

Lodash
_.isSymbol(null);   // → false
_.isSymbol(1);      // → false
_.isSymbol({});     // → false
_.isSymbol('sym');  // → false
Try It Yourself

How It Works

  1. nullish / number. Wrong types → false.
  2. Object. Plain {} is not a Symbol.
  3. String label. 'sym' is text, not Symbol('sym').
  4. Rule. Only Symbol-branded values pass.

Browser & Runtime Support

_.isSymbol is a Lodash Lang helper since 4.0.0. It runs anywhere Lodash runs on an ES2015+ engine with Symbol — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.

✓ Stable · Lodash 4.0.0+

_.isSymbol()

Available in [email protected] full builds and the lodash/isSymbol modular import. Requires a runtime that provides the Symbol built-in (all modern engines).

100% With Lodash 4.x + Symbol
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
_.isSymbol Lodash 4.0.0+

Bottom line: Safe for production once Lodash is loaded on an ES2015+ runtime. Prefer import isSymbol from "lodash/isSymbol" for smaller bundles. For primitives only, typeof value === "symbol" is enough.

Frequently Asked Questions

_.isSymbol(value) returns true if value is a Symbol primitive or a boxed Symbol object. Strings, numbers, null, and plain objects return false.
Yes. Well-known symbols like Symbol.iterator are real Symbol primitives — _.isSymbol(Symbol.iterator) is true.
Yes. Lodash also accepts boxed Symbol objects. typeof alone reports "object" for those wrappers.
typeof only catches primitives. _.isSymbol also accepts rare Object(sym) wrappers via the [object Symbol] brand.
No. Symbol('x') !== Symbol('x'). Each call creates a new unique Symbol; the description is only for debugging.
Use import isSymbol from "lodash/isSymbol" or require("lodash/isSymbol"). Full build: import _ from "lodash" then _.isSymbol.

Next: _.isTypedArray()

Check whether a value is a typed array (Uint8Array, Float64Array, …).

_.isTypedArray() tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

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.

10 people found this page helpful