That's TypeScript. I can tell by the pixels defining a type above.
Neither Javascript nor Typescript require semicolon, it is entirely a stylistic choice except in very rare circumstances that do not come up in normal code.
The reason is the JS compiler removes whitespace and introduces semicolons only "where necessary".
So writing
function myFn() {
return true;
}
Is not the same as
function myFn() {
return
true;
}
Because the compiler will see that and make it:
function myFn() { return; true; }
You big ol' nerd. Tee-hee.
Fair enough, I like it better without but I don't have a strong preference and have no issue adapting to whatever the style of the repo is.
I learned about it researching tools to automatically enforce formatting style and came across StandardJS, which eliminates them by default.
Interesting, I'm not aware of any way they would affect compile errors. I'd be curious to know more.
@programming.dev
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
go to feed...
@programming.dev
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
go to feed...
i would say why would you just not to
isAdmin = truebut i also worked with someone who did just this so i'll instead just sigh.also the real crime is the use of javascript tbh
save