Comments - fixed bad sample

This commit is contained in:
Dumitru Deveatii 2019-01-28 17:58:45 +02:00
parent 79dbfdee46
commit b5c0dc3998

View file

@ -251,13 +251,13 @@ Comments are an apology, not a requirement. Good code mostly documents itself.
```ts
// Check if subscription is active.
if (subscription.endDate < Date.now) { }
if (subscription.endDate > Date.now) { }
```
**Good:**
```ts
const isSubscriptionActive = subscription.endDate < Date.now;
const isSubscriptionActive = subscription.endDate > Date.now;
if (isSubscriptionActive) { /* ... */ }
```