Extended the javascript string operator

If you want to extend a javascript object:

// Define the function to do what you want
function first3char() {
    return this.substr(0,3); // 'this' will be the variable that's passed in

// Extend the javascript string operator

// Call your extension using the string 'abc123'

Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
Logged IP:
To prevent spam please submit by clicking the kitten: