Javascript examples for Object:prototype
Adding a method to String class via Prototype using prototype.__defineGetter__
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/*from ww w.j ava 2 s.c om*/ String.prototype.__defineGetter__("world", function() { return this + ' world'; }); console.log("hello".world); }); </script> </head> <body> </body> </html>