Currently browsing Methods, Events and Scopes

Monday, May 16, 2022

How to Get and Set URL Parameters with JavaScript

This is an old script, which helped a lot with the initial phase launching a project on all browsers and…

Monday, May 16, 2022

How to Implement a Service Worker in Your Website and How to Create a Basic PWA

You definitely don’t need a plugin for this. Although there are plugins which help with creating a service worker and…

Monday, May 16, 2022

Cross-browser Query Parameter Getter and Setter

Here’s a cross-browser compatible way of getting query parameter from a URL or setting query parameters and reloading the page. An…

Monday, May 16, 2022

How to Autoplay a Video Element Using JavaScript

The latest Chrome version has stopped video autoplay if the video is not muted. Firefox and the other browsers will soon…

Monday, May 16, 2022

JavaScript Data Types

Every variable in JavaScript has a data type which dictates the values that can be stored in it. However, JavaScript…

Monday, May 16, 2022

How to Compare Version Numbers in JavaScript

The basic idea to make this comparison would be to get arrays of parts from the version numbers and then compare pairs…

Monday, May 16, 2022

Useful JavaScript String Prototypes

This is a function to remove all double whitespaces and preceding line breaks. This is a function to replace all line…

Monday, May 16, 2022

truthy and falsy in JavaScript

In JavaScript, any variable can be used in a logical context, such as the condition of an if statement or…

Wednesday, June 15, 2022

Promises in JavaScript

Writing code in an async programming framework like node.js becomes super complex and unbearably ugly, superfast. You are dealing with…

Tuesday, May 10, 2022

Custom Events in JavaScript MVC

Events are the bread and butter in UI development. They are frequently used to kick off JavaScript to deal with…

Tuesday, May 10, 2022

Cutting Loose: Dynamic Namespacing in JavaScript

Most of the JavaScript libraries come wrapped in an easy to refer single object. The object acts as a namespace,…

Tuesday, May 10, 2022

Understanding JavaScript Currying

I recently fully understood the concept of utilizing Currying in JavaScript. The core concept can be grasped from these references: Wikipedia entry on…