Articles

Understanding Recursion in JavaScript

Published on:

Recursion happens when a function calls itself over and over.

A function that calls itself over and over is called a recursive function. Here's an example of a recursive function:

function helloWorld() {
  console.log('Hello world')
  helloWorld()
}

(Don't try this code because your browser would hang). I'll explain how you write a proper recursive function and why you may want to use one.

Best Practice for Astro Endpoints

Published on:

Astro strips away query parameters from endpoints if you're in a static rendering mode. So, unless you're using SSR for all your pages, you'll need to ensure that your endpoints are not pre-rendered.

What developers should be learning

Published on:

Many developers are learning frameworks and algorithms to keep up with trends — so they can continue to be employable.

That's one way of looking at things. But I propose another approach.

A Great Failed Experiment

Published on:

Couple of years ago (I forgot exactly when), I removed the dates that were preceeding the file names of my blog articles.

Data Table Accessibility in 2024

Published on:

A comment from Estelle Weyl sparked this whole article.

> I know the display property would override the native semantics of a table, like setting display: grid, but I am not sure if that is still the case."

(Emphasis mine).

This prompted me to do some research.

Found the Light

Published on:

After about a year (or two) of paralysis, I finally know how to move forward with Magical Dev School — particularly how I create courses and content.

Understanding and using npm exports

Published on:

npm exports lets you specify how users can import or require your files. (For instructions on using require, see below).

Invisible adversaries

Published on:

In Bravery, I mentioned I had a few fears.

These fears are real to me. They don't feel like the bogeyman that Seth Godin mentions in the Practice. If they are, perhaps I haven’t summoned enough courage to look them in the eye, enough to a point that they disappear, yet.

No more waiting

Published on:

When was the last time you waited for something?

Me? I hate to admit it. But the last time was today! (I've been waiting for my wife to watch a movie with me for MONTHS. And I eventually decided to stop waiting).

Handling cookies with Fetch's credentials

Published on:

Fetch has a credentials option that can be used to send credentials to servers. It has three possible values — omit, same-origin, and include.

  • What does each of these three values do?
  • Does Fetch send cookies to specific servers only?
  • Does Fetch send specific cookies only?

I couldn't find answers to these questions online so I began experimenting. I want to document my findings and experiments for people who have the same questions.

Using Cookies vs Local Storage for storing access tokens

Published on:

Many people have voiced strong opinions about whether one should use Cookies or localStorage to store credentials like access tokens.

The common argument is cookies are more secure, but localStorage is easier to use.

From my research, I believe neither argument is correct.

Bravery

Published on:

I’m in the process of doing one of the bravest things I have ever done in my entire career as a developer.

Move fast, break things

Published on:

You probably heard of this before.

It seems to be quite popular in the web development, indie-hacking, and startup worlds.

But it’s a horrible mindset to adopt.