Category

Programming Tutorials and Coding Guides

Explore programming tutorials with practical examples across multiple languages, scripting, and development concepts for beginners and advanced users.

Welcome to the Programming tutorials section, where you will learn coding concepts with real-world examples across multiple languages and platforms.

This category includes beginner to advanced guides covering scripting, automation, and application development in Java, JavaScript, Python, Go, TypeScript, and related stacks.

Whether you are learning programming for system administration or building applications, browse the articles below for practical examples and language-specific references.

Programming plays a crucial role in modern infrastructure and DevOps workflows. You can also explore DevOps and Linux to see how code integrates with system-level operations.

956 articles

Programming category illustration with code editor, automation, and debugging graphics
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 Akinlua4 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 Akinlua4 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 Akinlua4 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 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 equality: equals, == vs ===, and the equal sign

JavaScript equality: loose == vs strict ===, type coercion, null and undefined, NaN and Object.is. Short notes after snippets describe expected console output (Node.js v20.18.2).

Steve Alila6 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