jgillich
jgillich

Reputation: 76189

jslint: Closing bracket after var statement

As a javascript newbie, I follow jslint suggestions when possible. Now here is something that doesn't make any sense to me.

The following code is valid:

function func() {
    "use strict";
    var foo = function () {
        },
        bar = function () {

        };
}

And this is valid, too:

function func() {
    "use strict";
    var foo = function () {
    },
        bar = function () {

        };
}

Line 4 is different in these. Is this actually valid or is it a bug?

Edit 20.02: The Question was not whether this is correct JavaScript or not. It was whether this both is correct according to jslint. In this case there are two possibilities, where as usually there is only one way to write code 100% jslint-valid.

Upvotes: 0

Views: 54

Answers (1)

Quentin
Quentin

Reputation: 943142

The only difference is the amount of indentation, which is purely a matter of coding style and has no impact on the parsing of the code.

Upvotes: 3

Related Questions