Tag: JavaScript

What In Tarnation Are JavaScript Prototypes?

A friend of mine asked me the other day about the MDN JavaScript manual. He noticed something odd when he looked up a function. For example, the title on the page for "forEach" was not "forEach". It was "Array.prototype.forEach". My friend wanted to know what that prototype thing was all about. This…

How To Get a Comment Section On Your Static Site

In this article, I will show you how to implement a comment section on a static website with no backend. But first, let me explain what a static site is, and what a backend is. Static Site A static site is a website that has no dynamic content. Usually, they are written entirely with HTML, CSS, and…

Optimize Your Website

If you have ever used Google Chrome's Audit tool you've probably noticed that almost no matter what you do Audit will tell you that your CSS is blocking the rendering of your site. If you take a look at the report details Google recommends loading critical parts of your styling directly in the…

Single Page Application med ren JavaScript

React.js, Vue.js og Angular.js er alle tre meget populære biblioteker der bliver brugt til blandt andet at bygge Single Page Applications (SPAs). I dette indlæg vil jeg vise dig, hvordan du selv kan lave et lille bibliotek, der gør mange af de samme grundlæggende ting, som for eksempel Angular.js…

Signed Web Tokens

I dette indlæg vil jeg demonstrere hvordan du kan lave et signed JSON web token. Dette er et token, der består af at JSON-objekt og en signatur, som skal forhindre at nogen kan ændre tokenets indhold. For at komme i gang, skal vi bruge et kryptografi-bibliotek. Jeg bruger node.js' eget bibliotek…

So, What's A Block Chain?

I recently decided to dig down into the whole thing about blockchains, because I thought it sounded really interesting. I never actually bothered with trying to understand more than the very basic concept of BitCoin, but until now I also never understood what it actually is. The core concept behind…

Bedre dokumentation

Vi har alle set de her overkommenterede stykker kode, hvor nærmest hver eneste linie ender i en kommentar, der forklarer hvad den linie gør. Efter min mening er dette helt overflødigt. Kommentarer i kode bør altid have et klart formål - og hvis du har brug for at forklare hvad din kode gør, så har…