I think that i should ask new question about jSHint, discussion started here, i can see now strange warning from JSHint, i just want to know why.
This services was suggested.
So i have this code in JSHint:
var foo = function() {
return {
hi: console.log("foo")
} //line 15 <------ why we have to put ; here?
};
var foo1 = function() {
return // i know about ; here, please read post
{
hi: console.log("foo1")
}; // line 22 <---- why we don't need to put ; here?
};
I marked lines where i am getting warning via comment "this line" above.
So, question:
I have 2 strange warnings:
First warning 15 Missing semicolon.
about 15 line
Second warning 22 Unnecessary semicolon.
about 22 line
But those 2 lines looks for me identical, what am i missing? why we have 2 different warnings here?
EDIT
Question is not about behavior, question is about warnings. Why are they different?
I know that i missed semicolon in second return!