programming

JavaScript unshift(): Add Items to the Start of an Array

Learn JavaScript unshift() with array examples, return values, mixed data, and how to add one or more items to the beginning of an array.

Olorunfemi Akinlua3 min read
programming

JavaScript toLowerCase(): Convert a String to Lowercase

Learn JavaScript toLowerCase() with string conversion examples, case-insensitive comparisons, search normalization, and common use cases.

Olorunfemi Akinlua2 min read
programming

JavaScript toFixed(): Round Numbers to Decimal Places

Learn JavaScript toFixed() with rounding examples, string return values, precision gotchas, and how to convert the result back to a number.

Olorunfemi Akinlua3 min read
programming

JavaScript Timing Events with setTimeout and setInterval

Learn JavaScript timing events with setTimeout(), setInterval(), clearTimeout(), clearInterval(), and practical examples for delayed code.

Olorunfemi Akinlua3 min read
programming

Wait for Async Function to Finish in JavaScript

Learn how to wait for an async function to finish in JavaScript with await, then(), Promise.all(), and practical output examples.

Olorunfemi Akinlua2 min read
programming

replaceAll() with Regex in JavaScript

Learn how to use replaceAll() with regex in JavaScript with string replacement, regex patterns, and callback examples.

Olorunfemi Akinlua2 min read
programming

JavaScript use strict Mode Explained

Learn JavaScript use strict mode, common strict mode errors, scope rules, and how strict mode helps catch mistakes early in scripts and functions.

Steve Alila2 min read
programming

jQuery hide() Method with Examples

Learn the jQuery hide() method with syntax, duration options, callback behavior, and examples for hiding matched elements.

Steve Alila2 min read
programming

Remove Element from Array in JavaScript

Learn how to remove an element from an array in JavaScript with pop(), shift(), splice(), filter(), and delete examples.

Steve Alila3 min read
programming

Use Variable Inside Regex in JavaScript

Learn how to use a variable inside regex in JavaScript with RegExp, template literals, and practical replacement examples.

Olorunfemi Akinlua2 min read
programming

JavaScript XOR (^) Operator Explained

Learn JavaScript XOR with bitwise examples, numeric output, bit toggling, and practical uses for the exclusive OR operator.

Olorunfemi Akinlua2 min read
programming

Math.ceil() in JavaScript with Examples

Learn how Math.ceil() works in JavaScript with rounding up examples, negative numbers, and practical integer conversion cases.

Olorunfemi Akinlua2 min read
programming

JavaScript Wait 5 Seconds with setTimeout

Learn how to wait 5 seconds in JavaScript with setTimeout(), plus a Promise-based delay example and real timer output.

Olorunfemi Akinlua2 min read
programming

Create a Unique Array in JavaScript

Learn how to create a unique array in JavaScript with Set, filter(), and findIndex() examples, including how to remove duplicate objects by key.

Olorunfemi Akinlua2 min read
programming

Math.pow() and Power Operator in JavaScript

Learn how to use Math.pow() and the exponentiation operator in JavaScript with Number, BigInt, and practical power examples.

Olorunfemi Akinlua2 min read
programming

Round Down a Number in JavaScript

Learn how to round down numbers in JavaScript with Math.floor(), Math.trunc(), and comparison with Math.round() examples.

Olorunfemi Akinlua2 min read
programming

Pair Sum LeetCode Solution in JavaScript

Learn how to solve the LeetCode pair sum problem in JavaScript with brute force and hash map examples, plus tested output.

Olorunfemi Akinlua3 min read
programming

Objects are not valid as a React child

Learn why React throws objects are not valid as a React child, how to fix it, and how to render objects safely in JSX.

Steve Alila3 min read
programming

JavaScript textContent: Read and Update DOM Text

Learn JavaScript textContent to read, update, and clear text in DOM elements, plus compare textContent with innerText and innerHTML.

Steve Alila4 min read
programming

JavaScript Thenable Objects and Promise.resolve()

Learn JavaScript thenables, Promise.resolve adoption, thenable vs promise differences, and how thenable objects work with await.

Olorunfemi Akinlua3 min read
programming

Math.abs() in JavaScript with Examples

Learn how Math.abs() works in JavaScript with absolute value examples, type coercion behavior, and difference calculations.

Olorunfemi Akinlua2 min read
programming

JavaScript toString() Method with Examples

Learn how JavaScript toString() works with numbers, arrays, booleans, and how it differs from JSON.stringify().

Olorunfemi Akinlua2 min read
programming

JavaScript for Loop with Index Examples

Learn how to get the index in JavaScript for loops with for...of, entries(), for...in, and practical index output examples.

Olorunfemi Akinlua2 min read
programming

JavaScript chain functions: nested calls, method chaining, map filter reduce

How to chain functions in JavaScript: javascript chain functions, js chain functions, function chaining in javascript, nested calls f(g(h(x))), fluent return this APIs, array pipelines filter map reduce, and pipe vs …

Olorunfemi Akinlua5 min read
programming

JavaScript arrow function: fat arrow syntax, this, return object, tutorial

How arrow functions work in JavaScript: js arrow function, arrow function javascript, javascript fat arrow => syntax, concise vs block body, js arrow function return object with parentheses, lexical this vs methods, no …

Olorunfemi Akinlua5 min read
programming

JavaScript array unique: Set, filter, reduce, Map, and NaN pitfalls

How to dedupe arrays in JavaScript: javascript array unique, js array unique, javascript unique array, distinct array javascript with Set spread, Array.from, filter plus indexOf, reduce plus includes, for loops, Map by …

Olorunfemi Akinlua5 min read
programming

JavaScript object literals: syntax, shorthand, spread, and JSON

Create objects with property pairs, shorthand keys, computed keys, methods, spread, and JSON.parse — all from object literal syntax.

Olorunfemi Akinlua4 min read
programming

JavaScript array slice: slicing, negative indexes, slice vs splice, TypedArray

How Array.prototype.slice works in JavaScript: javascript array slice, js array slice, javascript array slicing with slice(start, end), exclusive end, negative indices, shallow copy, slice vs splice, TypedArray subarray …

Olorunfemi Akinlua5 min read
programming

JavaScript array pop: remove last element, return value, empty array, slice

How pop works in JavaScript: javascript pop, javascript array pop, js array pop with Array.prototype.pop, return value, empty array undefined, pop in javascript, generic array-like objects, and immutable alternatives …

Olorunfemi Akinlua5 min read
programming

Flatten array JavaScript: flat, flat(Infinity), flatMap, concat, reduce

How to flatten an array in JavaScript: flatten array javascript, js flatten array, javascript flatten array with flat(), depth and Infinity, flatMap vs map+flat(1), recursive concat/reduce for legacy engines, non-array …

Olorunfemi Akinlua5 min read