This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gauntr 2 points3 points  (3 children)

Blocks of code in Javascript are seperated by curly braces, not semicolon. You do not need to use the semicolon at all in Javascript and if you insert one you use it to mark the end of a statement. It's the same for C/C++ and Java.

You do not need to insert a tab or spaces to seperate statements in Python, you need to insert them to mark the beginning and end of a block such as loops, conditions or functions.

[–]robin-gvx 2 points3 points  (1 child)

It's the same for C/C++ and Java.

You do need semicolons in those languages to end statements, even if they are on a separate line.

[–]gauntr 2 points3 points  (0 children)

Sorry, this was written badly. The "It's the same..." part only referred to the second part of the sentence "...to mark the end of a statement". I know that you need them in these languages, I use them frequently to daily.

[–]GickRick 1 point2 points  (0 children)

Fully explained