DEV Community

loading...

Discussion on: What programming best practice do you disagree with?

Collapse
metruzanca profile image
Samuele Zanca • Edited

Oof, 6 months old buuuuttt. Yes, it does compile. Just like js, it's there for convenience when editing. You can't however do that in object initializers e.g.:

var obj = new MyClass
{
  item1, //shorthand if same name
  item2 = item2, //<—this comma gives error
};

(on mobile, fingers crossed for formatting)