Abdessalam Benharira a passionate JavaScript developer

Latest posts

Create an interactive CLI menu with Node.js

I have recently had to create an interactive menu for a project. I started programming it in bash and to tell the truth I quickly felt limited when I ...

Loading script asynchronously as a Promise in JavaScript

In most projects, an external library must be used (e.g. YouTube Player, Google Maps…), so the idea is to create a function to load the script asynchr...

Wrap an element with custom createElement in JavaScript

createElement function creates a wrapper element from a string. wrap function uses it to easily wrap a given element arround the wrapper string. The g...

Using navigator.sendBeacon

When it comes to logging user activity, like tracking stats or analytics data or even logging app errors, consider using navigator.sendBeacon(). The n...

Catching exceptions in setTimeout and setInterval

Errors and exceptions are among the problems encountered in any programming conceptions. By producing these errors, whether they are probable or not, ...