//String.prototype.
console.log(typeof String);
console.log(typeof Object);
String.prototype.aa = function() {
alert(this);
//console.log(this);
return 'aa';
};
console.log("asdf".aa());
Function.prototype.method = function(name, func) {
this.prototype[name] = func;
return this;
};
String.method('bb', function() {
return 'bb';
});
console.log("asdf".bb());
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>