C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
JavaScript Symbol.prototype PropertyThe JavaScript Symbol.prototype symbol is used to produce the prototype for the symbol constructor. Note: Symbol.prototype is the parent of all symbol objects and parent of Symbol.prototype is obect.prototype.Syntax
Symbol.prototype Parameters
No parameters Return valueThe prototype for the symbol constructor. Browser Support
Example 1
<script>
//JavaScript to illustrate Symbol.prototype()
var a = Symbol('Java');
Symbol.prototype.toString = function()
{
return ('JavaTpoint');
}
document.write(a.toString());
//expected output:JavaTpoint
</script>
Output: JavaTpoint Example 2
<script>
//JavaScript to illustrate Symbol.prototype()
var a = Symbol('Java');
Symbol.prototype.toString = function()
{
return ('10');
}
document.write(a.toString());
//expected output: 10
</script>
Output: 10
Next TopicJavaScript Symbol
|