Posts
JavaScript Basics: Validate Environment Variables in Node.js
Environment variables let you configure a program when you launch it. A setting that looks like a number or boolean still arrives as text, so checking it early prevents confusing …
October 14, 2026
JavaScript Basics: Test Small Functions With Node's Built-in Runner
A function can look correct and still mishandle an empty input or a boundary value. Automated tests turn those expectations into checks you can repeat after every change. This …
October 14, 2026
JavaScript Basics: Split Reusable Code Into ES Modules
When two scripts need the same helper function, copying it creates two places to maintain. An ES module lets one file export useful code and another import it. We’ll put a greeting …
October 14, 2026
JavaScript Basics: Build and Edit URLs With URLSearchParams
A search term such as tea & cake needs special handling inside a URL. Joining strings by hand can accidentally turn part of the term into another query parameter. JavaScript’s URL …
October 14, 2026
JavaScript Basics: Add Command-Line Options with parseArgs
A command-line option lets someone change a script’s behavior without editing its source. This tutorial builds a small greeting command with a name, repetition count, uppercase …
October 14, 2026
JavaScript Basics: Reading Local Files with async and await
A small Node.js script can read a report without blocking JavaScript while the file operation is pending. This walkthrough uses local text files to show successful reads, a …
October 14, 2026
JavaScript Basics: Parse, Validate, and Write JSON
JSON is text for exchanging data. A JavaScript object is a value your program can use. Crossing that boundary takes two familiar functions: JSON.parse() reads JSON text, and …
October 14, 2026
JavaScript Basics: Count, Look Up, and Deduplicate with Map and Set
An array is convenient when order and repeated values matter. Sometimes your real question is different: how many times did this label appear, which record has this ID, or have I …
October 14, 2026
JavaScript Basics: Transform Arrays Without Changing the Original
A list often needs several small changes before it is ready to display: remove unavailable items, calculate a value for each remaining item, and put the results in order. …
October 14, 2026
JavaScript Basics: Read Object Options With Reliable Defaults
Optional settings look simple until a valid value is 0, false, or an empty string. Another common surprise is copying an object and accidentally changing a nested value in the …
October 14, 2026