Currently browsing Methods, Events and Scopes

Wednesday, July 12, 2023

A collection of modern native JavaScript object and array utilities

Arrays Chunk Creates an array of elements split into groups the length of size. Compact Creates an array with all…

Monday, August 29, 2022

Code Golfing Tips & Tricks: How to Minify your JavaScript Code

JavaScript golfing is the process of writing the smallest amount of JavaScript code to do something awesome.

Tuesday, August 9, 2022

The Complete JavaScript Strings Reference

JavaScript strings are deceptively complex constructs. There are actually two different types of strings – string Literals and string Objects…

Monday, July 4, 2022

JavaScript Form Validation

This JavaScript code snippet adds inline validation to any form field (input, select and textarea). Feel free to customise it…

Tuesday, May 17, 2022

How to Optimize a Theoretical Funnel Page Load Speed

Here’s a quick snippet to preload the next step in a theoretical funnel/workflow: PHP JavaScript

Tuesday, December 27, 2022

Numerical Integration Using JavaScript

This is a quick reminder on how to use mathematical functions inside JavaScript. Instructions Trig: sin, cos, tan, cot, sec,…

Tuesday, May 17, 2022

Random JavaScript Tutorials

I needed some structural updates for a site, and among them, I added some JavaScript snippets. I will show you…

Tuesday, May 2, 2023

How to declare a global variable inside a jQuery function

A JavaScript global variable is a variable with global scope, meaning that it is visible and accessible throughout the program, unless…

Friday, June 3, 2022

How to execute code for X visits

This JavaScript will let you execute code a certain number of times. For example, you might want to only show…

Friday, June 3, 2022

JavaScript shortcuts for TRUE and FALSE

Here’s a neat trick if you’re into micro-optimization. JavaScript compressors and minifiers are used to make JavaScript code smaller and,…

Monday, May 16, 2022

🍪 How to Expire localStorage Items and Replace Cookies

I don’t use 🍪 cookies anymore, I think they are too… rigid. I use localStorage items. By default, they don’t…

Monday, May 16, 2022

How to extract a value from an element and, optionally, round it

This JavaScript snippet will extract a price from a DOM element, remove all alphanumeric characters, such as currency or symbols…