JavaScript String prototype Property

Clash Royale CLAN TAG#URR8PPP
<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]-->
JavaScript String prototype Property
❮ JavaScript String Reference
Example
Use the prototype property to add a new property to all objects of a given
type:
function employee(name, jobtitle, born)
this.name = name;
this.jobtitle = jobtitle;
this.born = born;
employee.prototype.salary = 2000;
var fred = new employee("Fred Flintstone", "Caveman", 1970);<!--
The value of fred.salary will be:
2000-->Try it Yourself »
Definition and Usage
The prototype property allows you to add new properties and methods to
existing object types.
Note: Prototype is a global property which is available with almost
all JavaScript objects.
Browser Support
| Property | |||||
|---|---|---|---|---|---|
| prototype | Yes | Yes | Yes | Yes | Yes |
Syntax
object.prototype.name = valueTechnical Details
| Return Value: | A reference to the String.prototype object |
|---|---|
| JavaScript Version: | ECMAScript 1 |
❮ JavaScript String Reference