Author

Olorunfemi Akinlua

Olorunfemi Akinlua

at · 173 articles published

Boasting over five years of experience in JavaScript, specializing in technical content writing and UX design. With a keen focus on programming languages, he crafts compelling content and designs user-friendly interfaces to enhance digital experiences across various domains.

Areas of expertise

Author profile illustration for Olorunfemi Akinlua — technical writer at GoLinuxCloud

Articles by Olorunfemi Akinlua

programming

Find GCD in JavaScript (Euclidean algorithm, BigInt, mathjs)

GCD in JavaScript (greatest common divisor, not denominator): Euclidean gcd recursive and iterative with Math.abs for negatives, reduce fold for many numbers, BigInt gcd without mixing Number, optional mathjs variadic …

Olorunfemi Akinlua4 min read
programming

JavaScript splice(): Add, Remove, and Replace Array Elements

Learn JavaScript splice() with examples to remove, add, and replace array elements, understand mutation, return values, and slice vs splice.

Olorunfemi Akinlua2 min read
programming

Replace Substring in JavaScript with replace() and replaceAll()

Replace substrings in JavaScript with replace(), replaceAll(), regex, and replacement functions—first match, all matches, and capture groups.

Olorunfemi Akinlua3 min read
programming

Remove Last Character from String in JavaScript

Learn how to remove the last character from a string in JavaScript using slice(), substring(), replace(), and Unicode-safe Array.from() examples.

Olorunfemi Akinlua3 min read
programming

JavaScript Open New Tab with window.open()

Learn how to open a new tab in JavaScript with window.open(). See _blank examples, noopener and noreferrer, popup blocker rules, same-tab alternatives, and secure browser behavior.

Olorunfemi Akinlua3 min read
programming

JavaScript Merge Objects: Spread, Object.assign, and Deep Merge

Merge objects in JavaScript: spread, Object.assign, shallow vs deep copies, overwrite order, and when structuredClone fits.

Olorunfemi Akinlua3 min read
programming

Mediator Pattern in JavaScript: Practical JS Example

Mediator pattern in JavaScript: central coordinator, reduced coupling between components, when to prefer it over Observer, and a small runnable example.

Olorunfemi Akinlua3 min read
programming

JavaScript Observer pattern (EventTarget and custom pub/sub)

Implement the Observer pattern in JavaScript with EventTarget, callback lists, Pub/Sub differences, error handling, and avoiding listener leaks.

Olorunfemi Akinlua3 min read
programming

JavaScript Singleton Pattern with Class and Module Examples

Learn the JavaScript singleton pattern with class-based singleton, module singleton, getInstance examples, and when to avoid global state.

Olorunfemi Akinlua2 min read
programming

JavaScript Mouse Events: click, dblclick, mousedown, mouseup and mouseover

JavaScript mouse events: click, dblclick, mousedown, mouseup, mouseover, mouseenter, mouseout, mouseleave, mousemove, target, and coordinates—with Node-friendly snippets where possible.

Olorunfemi Akinlua3 min read
programming

JavaScript Remove Element from DOM with remove() and removeChild()

Learn how to remove DOM elements in JavaScript using element.remove(), parentNode.removeChild(), querySelector(), event handlers, and safe null checks.

Olorunfemi Akinlua3 min read
programming

JavaScript Replace DOM Element with replaceChild() and replaceWith()

Learn how to replace DOM elements in JavaScript using replaceChild(), replaceWith(), createElement(), text replacement, and safe element checks.

Olorunfemi Akinlua2 min read
programming

JavaScript scrollTo(): Scroll Window or Element Position

Learn JavaScript scrollTo() with window.scrollTo(), smooth scrolling, scroll to element, scrollIntoView(), and scroll position examples.

Olorunfemi Akinlua2 min read
programming

JavaScript YAML Parser: Parse YAML in Node.js

Learn how to parse YAML in JavaScript and Node.js with yaml and js-yaml, read YAML files, convert YAML to JSON, and handle parser errors safely.

Olorunfemi Akinlua4 min read
programming

JavaScript return vs throw: When to Return Errors or Throw

Understand return vs throw in JavaScript, when to return error values, when to throw errors, and how try...catch handles exceptions.

Olorunfemi Akinlua3 min read
programming

JavaScript JSON.parse(): Parse JSON Strings, Objects, and Files

JSON.parse in JavaScript: valid JSON strings, SyntaxError on bad input, reviver functions, and safe parsing habits.

Olorunfemi Akinlua2 min read
programming

Factorial Function in JavaScript Using Recursion

Learn how to write a factorial function in JavaScript using recursion, base cases, input validation, and an iterative alternative.

Olorunfemi Akinlua3 min read
programming

JavaScript Recursive Map Object: Transform Nested Values

Learn how to recursively map over a JavaScript object, transform nested values, preserve arrays, and create a new object without mutating input data.

Olorunfemi Akinlua3 min read
programming

JavaScript Recursive Search in Array of Objects

Learn how to recursively search an array of objects in JavaScript, find nested objects by ID, return all matches, and search child arrays safely.

Olorunfemi Akinlua3 min read
programming

JavaScript Recursive Generator with yield* Examples

Learn JavaScript recursive generators with function*, yield, yield*, tree traversal, converting generators to arrays, and practical examples.

Olorunfemi Akinlua3 min read
programming

JavaScript Pattern Matching with RegExp Examples

Learn JavaScript pattern matching with regular expressions using search(), match(), matchAll(), replace(), split(), and the RegExp constructor.

Olorunfemi Akinlua4 min read
programming

JavaScript Optional Parameters and Default Values

JavaScript optional parameters: default parameters, undefined vs null, options objects, destructuring defaults, and arguments.length patterns.

Olorunfemi Akinlua2 min read
programming

JavaScript Promise.reject(): Create and Handle Rejected Promises

Learn Promise.reject() in JavaScript with catch(), async/await, error handling, Promise.resolve comparison, and tested rejection examples.

Olorunfemi Akinlua3 min read
programming

JavaScript Promise.resolve(): Create Resolved Promises

Learn Promise.resolve() in JavaScript with resolved values, existing promises, thenables, async functions, and Promise.reject comparison.

Olorunfemi Akinlua3 min read
programming

JavaScript Promise.race (first settled promise)

JavaScript Promise.race explained: first settled promise wins, timeout patterns, empty iterable, non-Promise inputs, and how it differs from Promise.all and Promise.any. Every sample output was run on Node.js (V8).

Olorunfemi Akinlua4 min read
programming

JavaScript Set add(): Add Values to a Set

Learn JavaScript Set add() with examples showing unique values, chaining, object references, has(), size, and converting a Set to an array.

Olorunfemi Akinlua2 min read
programming

JavaScript NodeList: querySelectorAll, forEach, and Array.from

Learn JavaScript NodeList with practical examples. Understand NodeList vs Array, NodeListOf, querySelectorAll, forEach, Array.from, static NodeList behavior, and NodeList vs HTMLCollection.

Olorunfemi Akinlua2 min read
programming

JavaScript querySelector(): Select DOM Elements with CSS Selectors

Learn JavaScript querySelector() with CSS selectors, document.querySelector(), querySelectorAll(), null checks, selector errors, and practical DOM examples.

Olorunfemi Akinlua3 min read
programming

JavaScript parseFloat(): Convert Strings to Decimal Numbers

Learn how JavaScript parseFloat() converts strings to decimal numbers, how it handles trailing characters, NaN, scientific notation, and how it differs from Number().

Olorunfemi Akinlua3 min read
programming

JavaScript startsWith(): Check if a String Starts With Text

Learn JavaScript startsWith() with examples for checking string prefixes, using the position argument, case sensitivity, and alternatives.

Olorunfemi Akinlua2 min read