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 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 Akinlua4 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 Akinlua3 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 Akinlua4 min read
programming

JavaScript error: IPython is not defined (Jupyter & matplotlib fix)

Fix missing IPython in the notebook browser context: secure URL, matplotlib backend (%matplotlib inline vs widget/ipympl), kernel restart, VS Code Jupyter extension, and Permissions-Policy. Includes one runnable Node …

Olorunfemi Akinlua5 min read
programming

JavaScript array fill: Array.prototype.fill, start/end, typed arrays, Array.from

How Array.prototype.fill works in JavaScript: javascript array fill, fill array js, array.fill with value and optional start/end, exclusive end, negative indices, object reference gotcha, new Array(n).fill, typed arrays, …

Olorunfemi Akinlua4 min read
programming

JavaScript DOM selectors: querySelector, getElementById, and more

JavaScript DOM selectors: querySelector, querySelectorAll, getElementById, getElementsByClassName, getElementsByTagName, live HTMLCollection vs static NodeList. Snippets use `{run=false}`—inject the sample HTML in a …

Olorunfemi Akinlua5 min read
programming

JavaScript dictionary: objects, Map, and dict patterns

JavaScript dictionary guide: plain objects vs Map for key-value data (js dict / dict in javascript). CRUD, iteration, Object.create(null), non-string keys, and Object.fromEntries. Short notes after snippets describe …

Olorunfemi Akinlua5 min read
programming

JavaScript destructuring: arrays, objects, defaults, and function params

javascript destructuring and destructuring assignment: array destructuring javascript (order, skip, rest, defaults), object destructuring javascript (rename, nested, rest), function parameters with = {}, for-of patterns, …

Olorunfemi Akinlua7 min read
programming

JavaScript deep copy: structuredClone, JSON, and when each one breaks

javascript deep copy, deep copy javascript, js deep copy, and deep copy object javascript: shallow spread and Object.assign, structuredClone for nested cloneable data, JSON.parse(JSON.stringify) limits, lodash cloneDeep, …

Olorunfemi Akinlua7 min read
programming

JavaScript CSV to array: read & parse CSV into arrays (browser & Node.js)

javascript csv to array and read csv file into array: 1D lists, 2D row arrays, and header-keyed objects; javascript parse csv with split for simple data, BOM and quotes, fetch and FileReader, Node readline and …

Olorunfemi Akinlua10 min read
programming

JavaScript arguments object vs parameters: strict mode, rest, and args

How the javascript arguments object works: args javascript, javascript arguments object vs parameters, sloppy-mode aliasing, strict mode, default parameters, variadic sum, Array.from(arguments), rest parameters vs spread …

Olorunfemi Akinlua4 min read
programming

JavaScript Nested Functions: Inner Function and Closure Examples

JavaScript nested functions: inner functions, scope, closures, private helpers, and when nesting stays readable.

Olorunfemi Akinlua3 min read
programming

Append to a JavaScript array: push, spread, concat (and prepend with unshift)

How to append to arrays in JavaScript: javascript append to array, js append to array with push and return value, push(...arr), spread literals, concat for new arrays, nested push gotcha, unshift prepend, and push.apply …

Olorunfemi Akinlua4 min read
programming

JavaScript event bubbling: DOM propagation and delegation

Event bubbling: inner-to-outer delivery, delegation on a parent, stopPropagation vs preventDefault, and capture phase contrast. Snippets use `{run=false}`—run in DevTools or with jsdom/happy-dom where markup exists.

Olorunfemi Akinlua4 min read
programming

JavaScript addEventListener (DOM events, options, and examples)

JavaScript addEventListener on document, window, and elements: click, capture vs bubble, removeEventListener, once, passive, AbortSignal, delegation, and Node EventEmitter. DOM snippets use `{run=false}` (install jsdom …

Olorunfemi Akinlua6 min read
programming

JavaScript forEach vs for...in (arrays and objects)

Compare Array.prototype.forEach with for...in on objects and arrays, when for...of wins, and how to avoid enumerable-key bugs. Runnable Node snippets with short output notes.

Olorunfemi Akinlua4 min read
programming

Date/time out of range in JavaScript (and the PostgreSQL pq error)

Compare Date values in JavaScript to detect out-of-range times, and fix PostgreSQL pq: date/time field out of range from bad string formats.

Olorunfemi Akinlua3 min read
programming

JavaScript add to array: push, unshift, splice, concat, spread, length

How to add to arrays in JavaScript: javascript add to array, js add to array with push, unshift, splice, toSpliced, concat, spread, length holes, javascript add array to array, mutating vs new array, and links to append …

Olorunfemi Akinlua4 min read
programming

Add days to a date in JavaScript (UTC, local, DST caveats)

How to javascript add days to date and js date add days: getUTCDate/setUTCDate for UTC calendar days, getDate/setDate for local wall calendar, immutable copy pattern, getTime + 86400000 ms vs DST, negative days, and Intl …

Olorunfemi Akinlua4 min read
programming

insertBefore in JavaScript (DOM, null, nextSibling)

insertBefore javascript and js insert before: parent.insertBefore(newNode, referenceNode), referenceNode null for end append, firstChild text nodes, insert after via nextSibling, TypeError if second arg omitted. Examples …

Olorunfemi Akinlua4 min read
programming

Call a function every second in JavaScript (setInterval, cleanup)

JavaScript call function every second and every 5 seconds with setInterval and clearInterval, recursive setTimeout when work overlaps, setTimeout delays, async delay helper, timer cleanup, and Node/browser throttling …

Olorunfemi Akinlua4 min read
programming

JavaScript array range (Array.from, start/stop/step, loop)

Numeric ranges with Array.from, start/stop/step helpers, loops, and keys(). Snippets include short expected-output notes from Node runs.

Olorunfemi Akinlua5 min read
programming

How to copy an array in JavaScript (shallow vs deep)

JavaScript copy array: shallow copies with spread, slice, Array.from, concat, map, and filter; deep copies with structuredClone; JSON limitations; sparse-array caveats. Snippets include short expected-output notes from …

Olorunfemi Akinlua6 min read
programming

HashSet in JavaScript (`Set`, uniqueness, Map vs dedupe)

Hashset JavaScript and js hashset: use Set for unique values like a HashSet, add/has/delete, SameValueZero and NaN, object identity, dedupe arrays with spread, Map when you need keys. Section intros explain each pattern; …

Olorunfemi Akinlua4 min read
programming

Convert string to array JavaScript (split, Array.from, Unicode)

How to convert string to array in JavaScript: string to array javascript, javascript string to array, js string to array, convert string to array javascript with split, Array.from, spread, javascript string to char …

Olorunfemi Akinlua5 min read
programming

JavaScript copy to clipboard (navigator.clipboard.writeText, secure context)

Copy text to the clipboard with navigator.clipboard.writeText, secure contexts, NotAllowedError, readText, and why execCommand is legacy. Node uses a stub clipboard in examples so snippets run; browsers need HTTPS and …

Olorunfemi Akinlua4 min read
programming

JavaScript clone object (shallow spread, structuredClone, JSON)

Clone objects in JavaScript: shallow spread and Object.assign, for...in, Object.create + descriptors, JSON limits, structuredClone and DataCloneError, and circular refs. Runnable Node snippets with short output notes; …

Olorunfemi Akinlua5 min read
programming

JavaScript classes tutorial (constructor, methods, static, extends)

JavaScript classes: constructor, instance methods, getters, static methods, extends and super, public fields, and private # fields. Runnable Node snippets with short expected-output notes; links to ranges and cloning …

Olorunfemi Akinlua5 min read
programming

JavaScript check if undefined (typeof, ===, void 0, nullish)

Check undefined in JavaScript: typeof for undeclared names, === undefined for declared bindings, falsy vs undefined, == null, void 0, and nullish coalescing (??) for defaults. Runnable Node snippets with short output …

Olorunfemi Akinlua4 min read
programming

JavaScript check if string is number (Number.isFinite, isNaN, parseInt)

Validate numeric strings in JavaScript: whole-token checks with trim + Number.isFinite, global isNaN pitfalls, parseInt prefix behavior, integers, strict regex decimals, and digits-in-text vs fully numeric. Runnable Node …

Olorunfemi Akinlua5 min read