JavaScript Symbol Methods

Beginner
4 min read
Updated: Nov 2026
5 method guides
Method index

About This Index

This page is the JavaScript Symbol Methods index. The Symbol object has two static methods, and every symbol has three instance methods. Each row below links to a full guide with syntax, examples you can run, and FAQs.

Learn what a Symbol is on /js/symbol. Use this page when you need a specific method such as Symbol.for().

Static or instance?

Symbol.for() and Symbol.keyFor() are called on the Symbol object itself. toString(), valueOf() and [Symbol.toPrimitive]() are called on a symbol you already have.

How to Call a Symbol Method

Call the static methods on Symbol, and the instance methods on a symbol:

JavaScript
const shared = Symbol.for("app.id");     // static: get a shared symbol
console.log(Symbol.keyFor(shared));      // static: "app.id"

const id = Symbol("id");
console.log(id.toString());              // instance: "Symbol(id)"
console.log(id.valueOf() === id);        // instance: true
console.log(id[Symbol.toPrimitive]("default") === id);   // instance: true

JavaScript Symbol Methods Table

All method guides in this JavaScript tutorial series (5 tutorials), grouped by what they do.

Shared symbols (global registry)

2 methods

Get the same symbol from anywhere in your program, and look its key up again.

MethodDescriptionTutorial
Symbol.for()Return the shared symbol for a key. The first call creates it, later calls return the same symbol.Open
Symbol.keyFor()Return the registry key of a shared symbol, or undefined for local and built-in symbols.Open

Convert and read a symbol

3 methods

Turn a symbol into text, unwrap it from an object, and learn which conversions are allowed.

MethodDescriptionTutorial
toString()Return the symbol as text such as "Symbol(id)". Needed because + and template literals throw.Open
valueOf()Return the primitive symbol, also from a wrapper object made with Object(symbol).Open
[Symbol.toPrimitive]()Return the symbol itself for any hint. Number(symbol) and symbol + 1 still throw a TypeError.Open

Frequently Asked Questions

Two static methods, Symbol.for() and Symbol.keyFor(), which work with the global symbol registry. Every symbol also has three instance methods: toString(), valueOf() and [Symbol.toPrimitive](). Each one has its own guide on this site.
The Symbol page explains the idea: unique values, hidden keys and why symbols do not convert to text. This index lists the method guides so you can jump straight to Symbol.for(), toString() or another method.
Symbol.for() and Symbol.keyFor() are static, so you call them on Symbol itself. toString(), valueOf() and [Symbol.toPrimitive]() are instance methods, so you call them on a symbol, as in id.toString().
description is a property and not a method, so it is not in this list. It returns the label you passed to Symbol(), for example Symbol("id").description is "id". It is explained on the Symbol page and in the toString() guide.
Start with Symbol.for(), because it shows how symbols can be shared. Then read Symbol.keyFor(), toString(), valueOf() and [Symbol.toPrimitive]() in order. If you want the big picture first, read the Symbol page.

Start with Symbol.for()

Open the guide for shared symbols: syntax, examples, and FAQs.

Symbol.for() 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