+ 1

Do you need to put a ; at the end of every line of code? (JavaScript)

19th Jan 2019, 9:48 PM
Pandazzling
Pandazzling - avatar
2 Answers
+ 2
Nope. Semicolons aren't necessary unless you want to compress all your code in a single line. But if you're writing code normally and you don't use any, JavaScript implicitly adds them to where it is necessary. So, it's pretty much a matter of preference.
19th Jan 2019, 11:17 PM
Jonathan Pizarra (JS Challenger)
Jonathan Pizarra (JS Challenger) - avatar
0
Jonathan Pizarra Thanks for clarifying!
19th Jan 2019, 11:21 PM
Pandazzling
Pandazzling - avatar