Articles by Steve Alila
JavaScript String Contains: includes(), indexOf(), and Regex
Learn how to check if a JavaScript string contains a substring using includes(), indexOf(), regular expressions, position checks, and case-insensitive search.
JavaScript Redirect to URL with location.href, assign, and replace
Learn JavaScript redirect methods using window.location.href, location.assign(), location.replace(), relative URLs, and redirect behavior in browser history.
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 …
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.
JSON.stringify() Pretty Print Examples
Learn how to pretty print JSON with JSON.stringify(), indentation, and replacer options for readable objects and arrays.
Show Calendar on Hover with JavaScript and jQuery
Learn how to show a calendar on hover with JavaScript mouseenter, jQuery hover, and focus examples.
Maximum Call Stack Size Exceeded in JavaScript
Learn why JavaScript throws maximum call stack size exceeded, how recursion causes it, and how to prevent the error with examples.
JavaScript use strict Mode Explained
Learn JavaScript use strict mode, common strict mode errors, scope rules, and how strict mode helps catch mistakes early in scripts and functions.
jQuery hide() Method with Examples
Learn the jQuery hide() method with syntax, duration options, callback behavior, and examples for hiding matched elements.
Remove Element from Array in JavaScript
Learn how to remove an element from an array in JavaScript with pop(), shift(), splice(), filter(), and delete examples.
Objects are not valid as a React child
Learn why React throws objects are not valid as a React child, how to fix it, and how to render objects safely in JSX.
JavaScript textContent: Read and Update DOM Text
Learn JavaScript textContent to read, update, and clear text in DOM elements, plus compare textContent with innerText and innerHTML.
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).
jQuery check if checkbox is checked (and JavaScript checked property)
Read checkbox state with HTMLInputElement.checked, jQuery .prop('checked') and .is(':checked'), why .attr('checked') misleads, and change events. Snippets use `{run=false}`—run in DevTools or with jsdom + jQuery 3.7; …
Cannot set headers after they are sent to the client (Express & Node.js)
Fix Error [ERR_HTTP_HEADERS_SENT] and cannot set headers after they are sent in Express/Node: double res.send, async races, middleware next(), error handlers, and res.headersSent—with tested client and log lines.
Check if an array is empty in JavaScript
Check if array is empty in JavaScript with length, Array.isArray, optional chaining, and loop patterns—plus pitfalls (array-like objects, sparse arrays). Includes Node-tested console output.
Git Remove Remote: Remove Origin, Upstream or Any Remote
Learn how to remove a Git remote, remove origin, remove upstream, verify remote removal, fix no such remote errors, and understand when to use remote remove, set-url, rename, or prune.
Git Remove File from Tracking Without Deleting It
Learn how to remove a file or folder from Git tracking without deleting it locally. Includes example git rm --cached output, .gitignore behavior, commit cleanup, directory removal, and skip-worktree patterns.
Git Reflog Explained: Recover Lost Commits, Reset, Amend & Branches
Learn what git reflog is and how to use it with practical examples. Recover commits after git reset --hard, restore amended commits, recover deleted branches, inspect stash reflog, and understand reflog expiration …
How to Delete a Repository in GitHub (Step-by-Step Guide)
Learn how to delete a repository in GitHub using both the web interface and command line. This guide explains how to remove GitHub repositories, delete local Git repositories, remove files and folders, and safely clean …
How to Unstage Files in Git (Without Losing Changes)
Learn how to unstage files in Git using git restore, git reset, and git rm commands. This guide explains how to remove files from the staging area, undo git add, unstage all files, and keep changes safely without losing …
Git Switch vs Checkout Explained (How to Switch Branch in Git)
Learn how to use git switch to change branches in Git. This guide explains git switch vs git checkout, switching branches, creating new branches, commands, examples, and fixing common errors.
Git Show Command Explained (View Commit Details, Diff & Files with Examples)
Learn how to use git show to view commit details, file changes, and diffs. This guide explains git show command usage, examples, viewing specific commits, files, tags, and comparing git show vs git diff and git log.
Git Stash Explained (Save Local Changes Without Commit + Examples)
Learn how to use git stash to save local changes without committing. This guide covers git stash commands, examples, applying and popping stashes, listing stashes, fixing errors like no local changes to save, and …
Git Tag Explained (Create, Push, Delete & Best Practices)
Learn how to use git tag to create, list, push, delete, and manage tags in Git. This guide covers tagging concepts, version tagging, commands, examples, and best practices for release management.
How to Squash Commits in Git (Combine, Clean History, Before & After Push)
Learn how to squash commits in Git using rebase and merge. This guide covers combining commits, squashing last N commits, squashing all commits in a branch, before and after push workflows, fixing errors, and recovering …
Git Set Upstream Explained (origin vs upstream + Fix Errors + Examples)
Learn how to set upstream in Git with practical examples, fix common errors like no upstream branch, and understand origin vs upstream. This guide covers git push --set-upstream, git branch upstream setup, fork …
Git rm Command Explained (Remove Files, Undo & --cached Examples)
Learn how to use the git rm command with practical examples. This guide covers removing files and folders, git rm vs rm differences, git rm --cached usage, undoing git rm, and handling real-world scenarios safely without …
npm run pass arguments (with & without --) – Complete Guide + Examples
Learn how to pass arguments to npm scripts using double dash (--) and without it. Includes real examples, npm_config usage, environment variables, and best practices for Node.js scripts.
Git Pull --Rebase Explained: Examples & When to Use
Learn how to use git pull --rebase with examples. Understand the difference between git pull and git pull --rebase, when to use rebase, and how to keep a clean commit history without merge commits.

