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

JavaScript check if string contains space or whitespace (indexOf, RegExp, trim)

Check if a string contains spaces in JavaScript: literal U+0020 vs Unicode whitespace, indexOf and includes, RegExp \s, trim for ends-only emptiness, and NBSP (U+00A0) pitfalls. Runnable Node snippets with short …

Olorunfemi Akinlua4 min read
programming

JavaScript double exclamation mark (!!): boolean coercion

JavaScript double exclamation (!!) vs Boolean(): same boolean coercion to true/false, truthy and falsy lists, TypeScript idiom, and why [] is truthy. Runnable Node snippets with short output notes.

Olorunfemi Akinlua5 min read
programming

JavaScript double question mark (??): nullish coalescing

JavaScript double question mark (??) is nullish coalescing: defaults only for null or undefined, unlike ||. Covers chaining, mixing with ||/&& (parentheses), and examples where 0 and empty string must be preserved. …

Olorunfemi Akinlua5 min read
programming

JavaScript findIndex: array findIndex and objects by property

findIndex javascript and js findIndex: predicate scan with Array.prototype.findIndex, return index or -1, optional thisArg, javascript find index of object in array by property, and how findIndex differs from find and …

Olorunfemi Akinlua4 min read
programming

Compare strings in JavaScript: ===, localeCompare, and case-insensitive matches

JavaScript string compare and string equals with === vs ==, localeCompare and Intl.Collator for locale-aware sorting, case-insensitive patterns, trim and Unicode normalize—with example console output.

Olorunfemi Akinlua6 min read
programming

Convert an array to a string in JavaScript (join, toString, JSON)

Convert array to string in JavaScript with join, toString, String(), toLocaleString, JSON.stringify, reduce, or loops—with example output and common pitfalls (objects, BigInt, null/undefined).

Olorunfemi Akinlua4 min read
programming

JavaScript appendChild() — add and move DOM nodes

Use Node.appendChild in JavaScript to add or move elements. Includes append vs appendChild, DocumentFragment batching, insertBefore, cloneNode, and jsdom-tested console output.

Olorunfemi Akinlua4 min read
programming

Convert SRT subtitles to plain text in JavaScript with regex

Convert srt to text or srt to txt in JavaScript: regex to remove index and timestamp lines, line-skip variant, block split for multi-line cues, Node readFileSync/writeFileSync with utf8—no npm install fs. Includes …

Olorunfemi Akinlua4 min read
programming

JavaScript date formatting with Intl.DateTimeFormat

Format dates in JavaScript with Intl.DateTimeFormat: locales, dateStyle and timeStyle, time zones, formatRange, formatToParts, and common TypeErrors. Includes tested sample output from Node.js (V8).

Olorunfemi Akinlua6 min read
programming

Parse a string to a boolean in JavaScript

Coerce strings with Boolean() and !!, or parse canonical values like 'true'/'false'. Learn the difference and avoid common mistakes.

Olorunfemi Akinlua2 min read
programming

Calling vs invoking functions in JavaScript: what actually happens to this

Call vs invoke and invoke vs call in JavaScript: both usually mean run a function. Clarify this binding, method calls vs free calls, Function.prototype.call naming, and library methods named invoke—with example console …

Olorunfemi Akinlua3 min read
programming

Detect ad blockers in JavaScript: bait DOM, heuristics, and what not to break

How to detect adblock in JavaScript: bait DOM patterns, getComputedStyle and offsetWidth checks, BlockAdBlock (blockadblock js) global guard, common API mistakes, limitations and false positives—with example branch logic …

Olorunfemi Akinlua5 min read
programming

Clear timeouts in JavaScript: clearTimeout and patterns that scale

Use clearTimeout (cleartimeout in search terms) to cancel one or many setTimeout timers. JavaScript has no built-in clear-all—track handles in a Set or array, including in Node.js. Includes Node-tested console output, …

Olorunfemi Akinlua5 min read
programming

JavaScript Exponentiation: ** Operator vs Math.pow (BigInt, precedence, edge cases)

Exponentiation in JavaScript with the ** power operator and Math.pow: numbers, BigInt, right-associativity, unary minus precedence, NaN ** 0, **= compound assignment, and when to prefer Math.pow on older engines. Each …

Olorunfemi Akinlua5 min read
programming

JavaScript await: async functions, try/catch, Promise.all, top-level await

How await works in JavaScript: javascript await, js await, async await javascript, await promise inside async functions, sequential vs Promise.all concurrency, try/catch on rejections, await on non-promises, top level …

Olorunfemi Akinlua4 min read
programming

JavaScript factory pattern (functions, classes, and async factories)

JavaScript factory pattern and factory functions: return plain objects, pick implementations by input, constructor-based factories, ES6 class factories, closure privacy, and async factories—with Node-tested output.

Olorunfemi Akinlua4 min read
programming

Error: cannot find module express

Error: Cannot find module 'express' This error is quite common and exists because when your code ran, the express package or module wasn’t found within its environment.

Olorunfemi Akinlua3 min read
programming

Error: Cannot find module X in JavaScript

We can solve Error: Cannot find module by installing the missing module. We can use npm tool to install the mising module.

Olorunfemi Akinlua12 min read
programming

How to add items to array in Node.js

We can use 3 different methods to add items to array in Node.JS using push, unshift or concat method

Olorunfemi Akinlua4 min read
programming

Wait For Loop to Finish in Node.js

We can use promise.all to check and wait for loop to finish in Node.js

Olorunfemi Akinlua4 min read
programming

Update key with new value in JavaScript

We can either use foreach loop of maps function to update key with new value in Javascript

Olorunfemi Akinlua4 min read
programming

How to sort a map by value in JavaScript?

Different methods to sort map by value in javascript (JS) in both ascending and descending order.

Olorunfemi Akinlua7 min read
programming

println JS alternative available?

The alternative of java println in javascript is console.log()

Olorunfemi Akinlua4 min read