Using a function in two different ways
===

I'm creating a function that attaches to other functions.

Like:

    string("Hi").capitilize()//returns hi

I want to be able to use $$.string in two different ways. 1 is attaching it to functions. The 2nd one is the function alone:

    string("Hi")

That is suppose to just return Hi. But all i'm getting is: `[object Object]`

The main code that allows me to do the first one, to attach to functions is: 

    var g = function (a) { 
            this._string = typeof a == "string" ? a : a.toString();
    		return a;
    }
    var string = function (a) {
                return new g(a);
    }

Then I have another variable with all of the functions in it and then bind it with prototype.

Is it possible to make this just return the string if I just have string("Hi") and still allow the functions to work if you add them?