What does 'this' mean in javascript below?

(Sorry, another thisjavascript question .)

I have the code below and I wonder what 'this' represents in the call at the end - Window or Bird?

var Bird = (function () {
    Bird.name = 'Bird';

    function Bird(name) {
        this.name = name;
    }

    Bird.prototype.move = function (feet) {
        return alert(this.name + (" flew" + feet + "ft."));
    };

    return Bird;

}).call(this);
+3
source share
4 answers

Well, if there is no parent area, this window

EDIT: see example: http://jsfiddle.net/Umseu/1

+7
source

Probably windowbecause it is not in any specific context that would give thisany particular significance.

+5
source

. .call(this) . , "Bird".

+3

console.log(this) . , window.

+1

All Articles