Type method in Javascript
<p>I come across below statement in various JS code where first a function let's say "test" is declared thereafter used as mentioned below:</p>

<p>type: "test"</p>

<p>Please explain what does this statement mean where "test" is a function name.</p>

<p>Sample code below:</p>

<pre><code>var MyFavoritesAjax = Class.create();
MyFavoritesAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, {

    ajaxFunction_getFavorites : function() {

        var result = this.newItem("result");

        result.setAttribute("message", "returning all favorites");

        this._addFavorite("color", "blue");
        this._addFavorite("beer", "lager");
        this._addFavorite("pet", "dog");

    },

    _addFavorite : function(name, value) {
        var favs = this.newItem("favorite");
        favs.setAttribute("name", name);
        favs.setAttribute("value", value);
    },

    type : "MyFavoritesAjax"

});
</code></pre>
