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 loop through object: forEach, keys, entries (javascript foreach object)

javascript foreach object, javascript loop through object, loop through object javascript, js foreach object, js loop through object, js object foreach, foreach object js, javascript iterate object, object foreach …

Olorunfemi Akinlua4 min read
programming

JavaScript get current date and time: new Date, UTC fields, and strings

javascript get current date, js get date, get current date javascript, javascript current date, javascript get date, js get current date, get date javascript, current date javascript, javascript datetime now: new Date(), …

Olorunfemi Akinlua5 min read
programming

JavaScript Keyboard Events: keydown, keyup, and keypress

JavaScript keyboard events: keydown, keyup, deprecated keypress, KeyboardEvent.key and code, repeat, preventDefault. happy-dom–style notes describe simulated output; DOM excerpts use `{run=false}` where appropriate.

Olorunfemi Akinlua6 min read
programming

Global variable in JavaScript: globalThis, var, strict mode, and multiple files

javascript global variable across files, javascript global variable, js global variable, global variable javascript, global variable in javascript, global var in javascript, var global js, var global javascript, global …

Olorunfemi Akinlua5 min read
programming

getBoundingClientRect in JavaScript: DOMRect, viewport coordinates, and performance

getboundingclientrect, get bounding client rect, getboundingclientrect javascript, javascript getboundingclientrect, js getboundingclientrect, boundingclientrect, getboundingclientrect performance, mdn …

Olorunfemi Akinlua5 min read
programming

JavaScript iterator and generator: iterators, js iterator, and generator patterns

javascript iterator, js iterator, iterator javascript, iterator js, javascript iterators, iterators javascript, iterators js, js iterators, iterators and generators in javascript, generator pattern javascript: Iterator …

Olorunfemi Akinlua4 min read
programming

instanceof in JavaScript: classes, functions, numbers, and the prototype chain

javascript instanceof, js instanceof, instanceof javascript, instanceof js, instanceof, instanceof in javascript, instance of javascript, instance of js, javascript instanceof function, javascript instanceof number: …

Olorunfemi Akinlua3 min read
programming

JavaScript functions as values: first-class functions and return values

JavaScript functions treated like variables: assign, pass, and return functions; how to return a value from javascript function vs returning a function; map callbacks; object and class methods; first order function in …

Olorunfemi Akinlua5 min read
programming

JavaScript indexOf: string and array indexOf in JS (indexof javascript)

javascript indexof, indexof javascript, js indexof, indexof js, indexof, indexof in javascript, indexof in js, index of javascript, index of js, index of in js: String.prototype.indexOf, Array.prototype.indexOf, …

Olorunfemi Akinlua4 min read
programming

JavaScript object has property: Object.hasOwn, hasOwnProperty, and the in operator

javascript object has property, javascript has property, js object has property, object has property javascript, has property javascript, javascript check if object has property, js has property, javascript hasproperty, …

Olorunfemi Akinlua4 min read
programming

localStorage event listener & storage event: addEventListener('storage') (local storage event listener)

localstorage event listener, local storage event listener, storage event listener, localstorage change event, localstorage events, localstorage event, addeventlistener storage, window addEventListener storage: …

Olorunfemi Akinlua4 min read
programming

JavaScript lastIndexOf: Get the Last Index in Strings and Arrays

JavaScript lastIndexOf for strings and arrays: find the last index of a value, use fromIndex, handle -1, compare indexOf vs lastIndexOf, and understand strict equality, NaN, and sparse arrays—with runnable Node examples.

Olorunfemi Akinlua6 min read
programming

JavaScript infinite loop: forever loop syntax, bugs, and how to avoid them

javascript infinite loop, infinite loop javascript, infinite loop in javascript, infinite loop js, js infinite loop, forever loop javascript, javascript endless loop, how to make an infinite loop in javascript, …

Olorunfemi Akinlua4 min read
programming

Linked list in JavaScript & JS: ListNode, build, traverse (linked list javascript)

linked list javascript, linked list js, javascript linked list, linked list in javascript, js linked list, linkedlist javascript, javascript linked lists, listnode js, javascript listnode, how to create a linked list in …

Olorunfemi Akinlua4 min read
programming

JavaScript get width of element: offsetWidth, clientWidth, getComputedStyle, DOMRect

javascript get width of element, javascript get element width, get width of element javascript, js get width of element, js get element width, get element width javascript, get width of element js, javascript element …

Olorunfemi Akinlua4 min read
programming

window.location.reload(true) deprecated: location.reload & forceGet (javascript location reload)

javascript:location.reload(true), javascript location reload true, location.reload(true), window location reload, location reload, window.location.reload(true) deprecated, mdn location.reload true deprecated, mdn …

Steve Alila4 min read
programming

JavaScript get element & find element: getElementById, querySelector, collections

js get element, javascript find element: getElementById, querySelector, querySelectorAll, getElementsByClassName, getElementsByTagName. Snippets use `{run=false}`—run with happy-dom/jsdom and the sample HTML in the …

Olorunfemi Akinlua3 min read
programming

JavaScript if not: logical NOT (!), if (!condition), and not in checks

javascript if not, if not javascript, if not in javascript, js if not, if not js, if not in js, not in javascript, not in js, javascript not, js not: logical NOT (!), if (!x), !==, !=, !(key in obj).

Olorunfemi Akinlua3 min read
programming

JavaScript Map Size: Check Number of Entries in a Map

JavaScript Map size: use map.size (not length), empty checks, and how set/delete/clear and duplicate keys change the count. Short notes after snippets describe expected console output.

Olorunfemi Akinlua5 min read
programming

JavaScript join() Method: Convert Array to String

JavaScript Array.prototype.join(): default comma separator, custom separators, empty string joins, null/undefined and sparse slots, nested arrays, and split/join patterns. Short notes after snippets describe expected …

Olorunfemi Akinlua6 min read
programming

JavaScript forEach vs for...in (and when to use for...of)

Compare forEach, for...in, and for...of in JavaScript: array methods vs enumerable keys, sparse arrays, Object.hasOwn, and break/continue. Short notes after snippets describe expected console output.

Steve Alila7 min read
programming

JavaScript map() with Index: Use the Array Map Index Argument

JavaScript map() with index: use the second callback argument in Array.map(), return index-based values, access the original array via the third argument, and understand sparse array holes.

Olorunfemi Akinlua3 min read
programming

Check if a Go Channel Buffer Is Full or Empty (len, cap, select)

Use len and cap on buffered Go channels to detect full or empty buffers, try a send with select and default, and know why unbuffered channels and “is it closed?” need different patterns.

Deepak Prasad4 min read
programming

JavaScript Integer Division (Divide Without Remainder Explained)

Learn how to perform integer division in JavaScript and divide numbers without remainder. This guide explains methods like Math.floor(), Math.trunc(), bitwise operators, and BigInt division with practical examples, edge …

Olorunfemi Akinlua8 min read
programming

JavaScript Math.sign(): Check Positive, Negative, Zero and NaN

JavaScript Math.sign(): -1, 0, 1 (and -0), NaN for non-numbers, and common sign-check patterns.

Olorunfemi Akinlua2 min read
programming

JavaScript Math.trunc(): Remove Fractional Digits

JavaScript Math.trunc(): drop the fractional part toward zero, compare trunc vs floor/ceil/round, and NaN behavior.

Olorunfemi Akinlua2 min read
programming

JavaScript Math.tan(): Tangent Examples in Radians and Degrees

JavaScript Math.tan(): tangent from radians, degrees conversion, and behavior near odd multiples of π/2.

Olorunfemi Akinlua2 min read
programming

JavaScript Math.log(): Natural Logarithm and Custom Base Examples

JavaScript Math.log(): natural log, log base 10, custom bases via change-of-base, and Infinity / NaN edge cases.

Olorunfemi Akinlua2 min read
programming

JavaScript Math.atan() and Math.atan2(): Arctangent Examples

JavaScript Math.atan() vs Math.atan2(): radians, degrees, quadrant-safe angles from (x, y), and when to prefer atan2 over y/x with atan.

Olorunfemi Akinlua4 min read
programming

JavaScript Math.asin(): Arcsine Examples in Radians and Degrees

JavaScript Math.asin(): arcsine in radians, domain -1 to 1, boundary values, NaN for invalid input, degrees conversion, and how it inverts Math.sin in range.

Olorunfemi Akinlua3 min read