MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/8xqmpv/what_people_think_coding_is/e25rxo7/?context=3
r/ProgrammerHumor • u/Cirriliath • Jul 10 '18
398 comments sorted by
View all comments
144
Whats up with all the front-end stufd, the missing ; which makes someone not sleep for 4 days and praising the achievement of being able to compile your code?
;
4 u/[deleted] Jul 10 '18 Just started messing with Javascript. Why do some lines need trailing semicolons and some lines don’t? 10 u/Jetbooster Jul 10 '18 Es6+ JavaScript don't give a shit. No lines need semicolons (at the end). Almost every style guide or linter will enforce it though.What you maybe are seeing is some lines are utilising promises, or some other chained function:functionCall() .then(...)If you were to put a semicolon in here it would break, because the .then() is dangling. It's technically a one liner over two lines.
4
Just started messing with Javascript. Why do some lines need trailing semicolons and some lines don’t?
10 u/Jetbooster Jul 10 '18 Es6+ JavaScript don't give a shit. No lines need semicolons (at the end). Almost every style guide or linter will enforce it though.What you maybe are seeing is some lines are utilising promises, or some other chained function:functionCall() .then(...)If you were to put a semicolon in here it would break, because the .then() is dangling. It's technically a one liner over two lines.
10
Es6+ JavaScript don't give a shit. No lines need semicolons (at the end). Almost every style guide or linter will enforce it though.
What you maybe are seeing is some lines are utilising promises, or some other chained function:
functionCall() .then(...)
If you were to put a semicolon in here it would break, because the .then() is dangling. It's technically a one liner over two lines.
144
u/[deleted] Jul 10 '18
Whats up with all the front-end stufd, the missing
;which makes someone not sleep for 4 days and praising the achievement of being able to compile your code?