Anonymous invocation

suggest change

Invoking a function as an anonymous function, this will be the global object (self in the browser).

function func() {
    return this;
}

func() === window; // true

In ECMAScript 5’s strict mode, this will be undefined if the function is invoked anonymously.

(function () {
    "use strict";
    func();
}())

This will output

undefined

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents