JS Symbol Explorer - Interactive Lab | IconVault
Explore every well-known JavaScript symbol with runnable examples, flow diagrams and copyable code. Free, in-browser.
JS Symbol Explorer
Well-known symbols with runnable examples
Symbol.iterator
Make any object work with for...of and spread
How it flows
for...of calls obj[Symbol.iterator]() once, then calls .next() on the result until done is true.
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
More tools
Algorithm Visualizer
Watch sorting and searching animate step by step
Alt Text Helper
Write better image alt text with live feedback
ARIA Reference
Searchable ARIA roles and attributes guide
Array Visualizer
Step through map, filter, reduce like a debugger
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