JS Symbol Explorer - Interactive Lab | IconVault

Explore every well-known JavaScript symbol with runnable examples, flow diagrams and copyable code. Free, in-browser.

All tools

JS Symbol Explorer

Well-known symbols with runnable examples

5 of 5 free uses left

Symbol.iterator

Make any object work with for...of and spread

How it flows

1

for...of calls obj[Symbol.iterator]() once, then calls .next() on the result until done is true.

2

Spread and destructuring use the same protocol..

const playlist = {
  songs: ["a", "b", "c"],
  *[Symbol.iterator]() {
    for (const s of this.songs) yield s.toUpperCase();
  },
};
[...playlist]; // ["A", "B", "C"]

Output

Press Run to execute the real code above and see what the symbol does.

5 of 5 free example runs left. Runs fully in your browser.

About this tool

IconVault's JS Symbol Explorer covers the twelve well-known symbols that wire JavaScript's protocols together, each with a runnable example and a step-by-step flow diagram. Run Symbol.iterator to make a custom object work with for...of and spread, watch Symbol.toPrimitive decide how your object converts to strings versus numbers, override instanceof with Symbol.hasInstance, or hook String.prototype.replace through Symbol.replace. It is free and runs fully in your browser, and every example is copyable.

The explorer also covers the symbols people meet less often but hit in real code: Symbol.species controlling what map returns on subclasses, Symbol.isConcatSpreadable changing concat behavior, Symbol.unscopables hiding Array methods from with blocks, Symbol.dispose for explicit resource cleanup, Symbol.metadata for decorators, and the global registry pair Symbol.for/Symbol.keyFor.

Frequently asked questions

Popular searches

javascript symbolssymbol.iterator examplewell known symbols javascriptsymbol.tostringtagsymbol.hasinstancesymbol.toprimitivesymbol.speciessymbol.replacesymbol.asynciteratorsymbol.disposejavascript symbol.forsymbol.keyforsymbol.isconcatspreadablesymbol.unscopablessymbol.metadata decoratorsjavascript unique symbolsglobal symbol registryjs symbol tutorialwhat are symbols in javascriptsymbol match javascriptsymbol.split examplecustom instanceof javascriptjavascript iterator protocol symbolfor of custom objectjavascript spread custom objectsymbol.tostringtag exampleobject.prototype.tostring symbolsymbol.species map subclassarray subclass map returnsconcat spreadable falsejavascript with statement unscopablesexplicit resource management javascriptusing declaration javascriptdecorator metadata symboljavascript symbol registrysymbol description javascriptare symbols enumerableobject.getownpropertysymbolsreflect.ownkeys symbolsjavascript private properties symbolsymbol vs string keywell-known symbols listsymbol.asynciterator for awaitasync iterable javascriptsymbol.toprimitive hintvalueof vs toprimitivecustom type conversion javascriptsymbol.hasinstance exampleoverride instanceofjavascript protocols explainediterable protocol javascriptjavascript meta programming symbolssymbol.matchallsymbol.replace regexstring replace custom objectjavascript symbol interview questions

More tools

Coming soon

CLI

Coming soon

Figma plugin

Coming soon

VS Code extension

Coming soon

Chrome extension

Coming soon

AI icon generator

Coming soon

Team workspaces

Coming soon

View all 10+ tools →