Difference between using .bind(this) and wrapping inside function class with JSlint ES5

Sorry if i ask similar questions, I am trying to better understand JS with JSlint as well as how this/.bind(this) ties into it.

I have 3 examples below which i am working with. I have figured out why example 1 and 3 behave the way are.

For example 2, i cannot figure out why JSlint complains about the “.” in .bind(this).

For example 3, i wonder if there is a way to optimise it?

The code can be copied and pasted into http://www.jslint.com/ to see the results in action.

Example 1: No JSlint warnings.

The issue is that “this” does not refer to window or an object which is why it’s undefined, which is why it cannot set “this.c”. Pretty self explanatory.

/*jslint devel:true, browser:true, this:true*/
/*global $, window*/

$(function () {
    "use strict";
    window.myApp = (function () {
        this.c = "c";

        this.main = function () {
            console.log("MAIN ", this.c);
        };
        this.main();
    }());
}());

Example 2: JSlint complains about the “.” in .bind(this), but otherwise the code is working

[jslint] Unexpected ‘.’. (unexpected_a)

/*jslint devel:true, browser:true, this:true*/
/*global $, window*/

$(function () {
    "use strict";
    window.myApp = (function () {
        this.b = 'b';

        this.main = function () {
            console.log('MAIN ', this.b);
        };
        this.main();
    }.bind(this)());
}.bind(this));

example 3: Wrapping inside function class App

In this case, JSlint does not show any errors/warnings, it is executed without an issue and all object are accessible.

/*jslint devel:true, browser:true, this:true*/
/*global $, window*/

$(function () {
    "use strict";
    window.myApp = (function () {
        function App() {
            this.a = "a";

            this.main = function () {
                console.log("MAIN ", this.a);
            };
        }
        var t = new App();
        t.main();
    }());
}());


Source: stackoverflow-javascript