Archive for category: Developers

                                                        

Inheritance and Prototypes in JavaScript

Things I didn’t realize existed in JavaScript In java every class inherits from a class called Object. This Object class has methods like toString() and equals() that other classes can use by default. That means, without defining such methods in themselves. Hence an object of Employee.java class can invoke the toString() function. And this is […]

                     

Working with the current index in Angular ngFor

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 […]

                     

Modules and Namespaces in JavaScript

modules and namespaces in javascript

For most of us, modules and namespaces in JavaScript were kinds of tricky. We import a bundle and it does the magic. How and why is abstracted away. And before modules, ideas of IIFE, closure, etc made this arena unreachable for junior JavaScript developers. Besides the easiness it brings, modularity has a number of advantages. […]

                     

The case of IIFEs in ES6

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. […]

                     

How to move or shift date by n number of days

shift date by n number of days

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 […]

                                           

Match Expressions in PHP8 over Switch statement

Match expressions in PHP8

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.

                     

Most common PHP string manipulation questions

Learn PHP string by answering the most common string manipulation questions

These are the most common PHP string manipulation questions that I had come around when I was getting started with PHP. Most of these easy concepts still confuse students. But let’s take few minutes and take them one by one. How do I combine two strings together? The first common PHP string manipulation question is […]

                     

A look into PHP implicit casting

PHP Implicit Casting

PHP implicit casting is very common. But before we see what it mean, let’s see why implicit casting happens. Again, PHP is supper-friendly. Also, it is a loosely typed language. In other words, PHP allows us to declare a variable and simply use it. And, PHP determines the data type of the variable automatically. Note: […]