programming

JavaScript Math.cbrt(): Calculate Cube Root in JavaScript

JavaScript Math.cbrt(): real cube roots for positive and negative numbers, how cbrt differs from ** (1/3), and when to prefer Math.cbrt.

Olorunfemi Akinlua2 min read
programming

JavaScript Math.random(): Random Numbers and Integers

JavaScript Math.random(): values in [0, 1), scaling to ranges and integers, why it is not crypto-grade, and when to use crypto.getRandomValues instead.

Olorunfemi Akinlua2 min read
programming

JavaScript Math.max(): Find the Maximum Number

JavaScript Math.max(): largest of two or many values, spread with arrays, and how -Infinity and NaN behave.

Olorunfemi Akinlua2 min read
programming

Remove Duplicates from Array in JavaScript

Learn how to remove duplicates from an array in JavaScript with Set, filter(), reduce(), and object key examples.

Olorunfemi Akinlua2 min read
programming

Convert JavaScript Dates to ISO Date String

Learn how to convert JavaScript dates to ISO date strings with toISOString(), template literals, and timezone-aware formatting examples.

Olorunfemi Akinlua2 min read
programming

Throw Errors in JavaScript the Right Way

Learn how to throw errors in JavaScript with Error, try-catch-finally, custom exceptions, and practical error handling examples.

Olorunfemi Akinlua2 min read
programming

JavaScript Validate Email Address with Regex

Learn JavaScript email validation with regex, HTML input type=email, and practical checks for valid and invalid email addresses.

Olorunfemi Akinlua2 min read
programming

Compare Dates in JavaScript with Examples

Learn how to compare dates in JavaScript with comparison operators, getTime(), and valueOf(), plus how to avoid timezone mistakes.

Olorunfemi Akinlua2 min read
programming

JavaScript URL Encode with encodeURI and encodeURIComponent

Learn JavaScript URL encoding with encodeURI() and encodeURIComponent(), including full URL encoding, query parameter encoding, and template literal examples.

Olorunfemi Akinlua2 min read
programming

JavaScript try catch: Handle Errors and Exceptions

Learn JavaScript try catch with syntax, thrown errors, finally blocks, return vs throw behavior, and practical error-handling examples.

Olorunfemi Akinlua3 min read
programming

Promise Chaining in JavaScript with then() and catch()

Learn promise chaining in JavaScript with then(), catch(), async/await, and Promise.all() examples that show how async steps flow together.

Olorunfemi Akinlua2 min read
programming

JavaScript Template Literals with Backticks and Expressions

Learn JavaScript template literals with embedded expressions, multiline strings, escaping backticks, tagged templates, and practical examples.

Olorunfemi Akinlua3 min read
programming

Create SVG with JavaScript

Learn how to create SVG with JavaScript using createElementNS, innerHTML, and safe SVG string examples.

Olorunfemi Akinlua2 min read
programming

Search JSON Objects Recursively in JavaScript

Learn how to search JSON objects recursively in JavaScript with value lookup, nested traversal, and practical examples.

Olorunfemi Akinlua2 min read
programming

JavaScript Typed Arrays Explained

Learn JavaScript typed arrays with Uint8Array examples, fill() and slice() usage, numeric buffers, and how typed arrays differ from regular arrays.

Olorunfemi Akinlua2 min read
programming

JavaScript Subclass with extends and super()

Learn JavaScript subclassing with class extends, super(), method overriding, instanceof checks, and prototype-based inheritance examples.

Olorunfemi Akinlua3 min read
programming

Spread Operator in JavaScript with Examples

Learn how the JavaScript spread operator works in function calls, arrays, and objects with practical examples.

Olorunfemi Akinlua2 min read
programming

JSON.stringify() Pretty Print Examples

Learn how to pretty print JSON with JSON.stringify(), indentation, and replacer options for readable objects and arrays.

Steve Alila2 min read
programming

Add Arrays in JavaScript with concat() and Set

Learn how to add arrays in JavaScript with concat(), spread syntax, and Set, including how to combine arrays and remove duplicates.

Olorunfemi Akinlua2 min read
programming

Sort an Array in JavaScript with sort()

Learn how to sort an array in JavaScript with sort(), compare functions, numeric ordering, and object sorting examples.

Olorunfemi Akinlua2 min read
programming

Show Calendar on Hover with JavaScript and jQuery

Learn how to show a calendar on hover with JavaScript mouseenter, jQuery hover, and focus examples.

Steve Alila2 min read
programming

Maximum Call Stack Size Exceeded in JavaScript

Learn why JavaScript throws maximum call stack size exceeded, how recursion causes it, and how to prevent the error with examples.

Steve Alila2 min read
programming

Convert Degrees to Radians in JavaScript

Learn how to convert degrees to radians in JavaScript with a custom helper function, Math.PI, and positive or negative angles.

Olorunfemi Akinlua2 min read
programming

Less Than or Equal to Operator in JavaScript

Learn how the less than or equal to operator works in JavaScript with number, string, and type coercion examples.

Olorunfemi Akinlua2 min read
programming

jQuery If Statement Examples

Learn how to use if, else if, and else logic in jQuery-driven scripts with practical condition checks and output examples.

Olorunfemi Akinlua2 min read
programming

jQuery Special Characters and Escaping Selectors

Learn how to handle special characters in jQuery selectors with escapeSelector(), quoted selectors, and safe string encoding examples.

Olorunfemi Akinlua2 min read
programming

Promise.all() in JavaScript with Examples

Learn how Promise.all() works in JavaScript with parallel promise examples, rejection behavior, and real output.

Olorunfemi Akinlua2 min read
programming

Math.floor() in JavaScript with Examples

Learn how Math.floor() works in JavaScript with rounding down examples, integer conversion, and random number generation.

Olorunfemi Akinlua2 min read
programming

JavaScript trim(): Remove Whitespace from Strings

Learn JavaScript trim(), trimStart(), and trimEnd() with input-cleanup examples, whitespace handling, and practical form validation use cases.

Olorunfemi Akinlua2 min read
programming

JavaScript replaceAll() for String Replacement

Learn JavaScript replaceAll() with string and regex examples, plus how to replace every matching value in a string.

Olorunfemi Akinlua2 min read