Multilingual greeter object After coming across Douglas Crockford's views on class-free OOP, and doing away with new and this in Javascript I tried defining an object with its own variable and function, and returning it in JSON, as shown below:

var newObj = function (name, lang){
    var obj = {
            "name":name,
            "greeter":greeter
    };
    return obj;
};

function greeter (lang){
        switch (lang){
                case "en":return "hi";
                case "es":return "hola";
                default: return "hello";
        }
}


//and finally, use the object    
var name = "john", lang = "es";  
var obj = newObj(name, lang);

console.log(obj.name);
console.log(obj.greeter(lang));


I know this code works in NodeJS, but I wonder if it is actually a good idea to do it this way. More specifically, are there any implications/consequences to returning functions within a javascript object that I should be aware of?
This is not JSON. However JSON was inspired from Javascript Native way of creating object. This is why they're really similar.

However JSON handles only data, not functions.

Furthermore you can rewrite your function like this : 

function newObj(name){
    this.name = name;
    return this;
};
newObj.prototype.greeter = function(lang){
    switch (lang){
            case "en":return "hi "+this.name;
            case "es":return "hola "+this.name;
            default: return "hello "+this.name;
    }
}

var obj = new newObj("name");
obj.greeter("de");


As you can see 


I got rid of the 2nd parameter in the newObj function since it was not used.
I bind greeter to the Object so now I can use this.name in greeter to greet you by your name.
If you try to JSONify this, everything under prototype will be ignored so you won't have any error.