Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <p>Open the JavaScript console to see the output.</p>
</body>
</html>
 
Object.defineProperty(String.prototype, "foo", {
  get: function() {
    // Here, `this` is the string
    return this.toUpperCase();
  }
});
console.log("hi there".foo);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers