How to make a super in javascript function

Viewed 1710

Like in this example:

var teste = {name:'marcos'};
$(teste).each(function(){

    var name = this.name; // i don't want to do that.

    // i want to have access to 'this' inside this function (sayName)
    var sayName = function(){
        alert(name); // there is something like "super" in java? or similar way to do?
    }
    sayName();

});

How can i do that?

3 Answers
Related