Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    It's not a question of correctness. It's rather a question of requirements and code styling. If the value of label is computed, you will use the first variant. If the value is like a constant, you will tend to the second variant (and probably use let instead of var). But the exception proves the rule. ;) Commented Nov 7, 2016 at 7:52
  • @macmoonshine I was afraid that the second one is a kind of a wrong way to do this. Thank you, now I see :) Commented Nov 7, 2016 at 7:56