Archive for category: Technical
Angular ngFor directive helps us loop over an item and interpolate it in our template file. Most of the time we might also be interested to get the current index in Angular ngFor. Furthermore, we might be interested in whether the items are located on the even or odd index. Angular provides an easy way […]
Do we need IIFEs in ES6? To answer this question let’s talk about IIFEs first. What the heck is IIFE? As a programmer who learned things by trial and error and who avoided scary topics at all costs, I can tell you honestly that I have missed IIFEs for the most part of my career. […]
Here is a quick way to shift a day by n number of days, by adding those days, and adjusting the date. In the process, we will pay attention to moving the days into another month or year if we have to. Of course, this depends on the few date manipulation methods we saw last […]
Constructor property promotion in PHP8 is one of the new features which make our code less verbose and less error-prone. Similar to the match expressions which I wrote about last week. Before we see what constructor property promotions in PHP8 look like, let’s take a look at a typical class declaration. As you can see, […]
Match expressions in PHP8 are among the many new features that encourage good standards when writing code. They might seem just another short-hand syntax. However, match expressions effectively replace switch statements and make our code cleaner, readable, and less prone to errors.