
Building a Seamless Drag-to-Reorder Widget with Vanilla JavaScript
Let's learn how to build a seamless widget in JavaScript.
Let's learn how to build a seamless widget in JavaScript.
A step-by-step guide for adding web push notifications to your web app.
Automated testing is a vital part of writing good code.
See how you can remove your null checks with the Null Object Pattern.
There are two clear ways to derive more data from the data you loaded into your app.
You can't check if two objects with same values are the same using the equality operator (===). Value Objects help us achieve that goal well.
Callbacks are a great tool for modifying the behavior of the internal parts of a function without touching the function code.
If you want to implement the undo functionality in your code, the command pattern is the way to go.
Long functions are usually harder to understand. But there are techniques that can improve their readability.
You don't have to write the fastest, cleanest algorithm the first time you implement it. If you extract it, you can improve it later.
Distinguishing between objects and records will help you make better decisions when designing your system.
Encapsulating your arrays will make them easy to change, easy to test, and less prone to errors.
Split phase refactoring will make your functions easier to read and change.
Using a factory function to create objects allows you to use the best feature of OOP—Polymorphism.
Sometimes using global data is inevitable. Is there anything you can do to protect your code from its bad consequences?
Good naming will make your code more readable and easier to understand.
Polymorphism is a concept. If you learn it, your code quality will change drastically.
Grouping your related functions under a class will give you a lot of opportunities to improve your code.
Long, complex conditional logic can make your code less readable. Extracting it into a dedicated function can fix that.
Passing the whole object to a function can be very beneficial. But sometimes the opposite is true.
Encapsulation is the best way to improve your code quality. Learn how it really works.
Adding your own data types can remove a lot of duplication in your code. Let me show you how.
Nested conditionals can make your code harder to read and change. But guard clauses come to the rescue.
Converting some parameters into an object gives you a lot of opportunities to improve your code design. It's more powerful than you expect.
Loops can become a source of confusion in certain parts of your code. Replacing them with collection methods like filter and map can simplify them drastically.