Why can’t I use commas for classes like with objects?


#1

Question

Why can’t I use commas for classes like with objects?

Answer

Classes and objects are different concepts, so they will have different syntax. If you do add commas between methods in your classes, you will get the following syntax error: SyntaxError: Unexpected token ,