Name the intention
This is a sample technical note demonstrating a short article layout.
A specific name can explain more than a generic data variable. A filtered collection of articles could be called visiblePosts.
const visiblePosts = posts.filter(post => !post.draft)
Keep changes at the boundary
Centralize date formatting, image URLs and interface translations. A rule can then change in one place.
Explain why
A comment can capture a decision that is not obvious from the code. Leave a useful clue for the next person reading it.
Join the conversation
No account needed. Add your name to comment. Email is optional and stays private.
Loading comments…