Example 1 — Demo
Core idea.
JavaScript
console.log(typeof Symbol.replace);
console.log(Symbol.replace.description || "(no description)");How It Works
- Well-known. Symbol.replace is a symbol.
- Role. Protocol used by String.prototype.replace.
Symbol.replace is a well-known symbol. Protocol used by String.prototype.replace.
console.log(typeof Symbol.replace);
console.log(Symbol.replace.description || "(no description)");Core idea.
console.log(typeof Symbol.replace);
console.log(Symbol.replace.description || "(no description)");CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
6 people found this page helpful