Function vs. Object Literal Notaion - is there a diifference?
<p>Both these ways work using the same call mechanism.</p>

<p>Obviously, I want to use the best way, but perhaps it is just a matter of preference?</p>

<p>Style-wise I like the Object Literal Notation because it provides enclosure.</p>

<p><strong>Function Notation:</strong></p>

<pre><code>var TextProcessor = function()
{
};
TextProcessor.unEscape = function( second_split )
{
    var element;
    for( element in second_split )
    {
        second_split[element] = second_split[element].replace( '**', '*', 'g' );
        second_split[element] = second_split[element].replace( '|*', '|', 'g' );
    }
    return second_split;
};
TextProcessor.pullBullet = function( text )
{
    var pattern = /&lt;(.+)_([a-z]){1}&gt;$/;
    return pattern.exec( text );
};
TextProcessor.pullDomain = function( text )
{
    return text.match( /:\/\/(www\.)?(.[^\/:]+)/ )[2];
};
</code></pre>

<p><strong>Object Literal Notation</strong></p>

<pre><code>/**
 *TextProcessor
 */

var TextProcessor = 
{
    unEscape:    function( text )
    {
        var index;
        for( index in second_split )
        {
            text[index] = text[index].replace( '**', '*', 'g' );
            text[index] = text[index].replace( '|*', '|', 'g' );
        }
        return second_split;
    },
    pullBullet:  function( text )
    {
        var pattern = /&lt;(.+)_([a-z]){1}&gt;$/;
        return pattern.exec( text );
    },
    pullDomain:  function( text )
    {
        return text.match( /:\/\/(www\.)?(.[^\/:]+)/ )[2];
    }
}
</code></pre>
