The coding articles collection contains curated stories, tips, questions and answers on a wide variety of topics. The main focus of these articles revolves around the languages and technologies presented in snippets, as well as career advice and lessons.
Closures are used frequently, yet often misunderstood. Understanding them in depth is crucial to be able to write clean, maintainable code.
Freezing objects is not the only way to prevent mutations. Learn how you can leverage the Proxy object to your advantage.
Nesting elements with rounded borders can look very wrong if not done correctly. Here's a quick tip on how to do it right.
Testing your code is important, but mocking can be tricky at times. Here's a quick guide on how to mock global object methods in Jest.
Are you performing a lot of array operations? Maybe element removal is a performance bottleneck you can avoid.
Testing React components that use portals can be difficult until you understand what you really need to be testing.
You can use a CSS pseudo-class selector to style all links in a page, without worrying if they have been visited or not.
Mutable default arguments can trip up Python beginners and veterans alike. Here's a quick workaround to deal with them.
It's generally not a good idea to use bare
except clause in Python, but do you know why?
Maps and objects are very similar, but they have some differences that can help you decide which one better fits your use-case.
Object.seal() serve a similar purpose, but there's one key difference you need to remember.
When working with files in Python, it's important to ensure that the file is closed correctly. Here are a couple of ways to do that.