Skip to Content
Skip to content
Tutorials

Programming Tutorials

Standalone programming tutorials for solving one specific problem at a time. Each guide starts with the exact error message, failing behavior, or design constraint, gives you a minimal reproducible script or query, and walks through the fix with real output.

Pick a language below or filter by topic and difficulty when you need a quick, practical reference you can test locally and apply right away.

JavaScript
Fix Form Comparisons That Confuse Blank Input With Zero Level: Beginner

Separate missing, invalid and numeric form input, then compare normalized quantities without treating an empty field as zero.

JavaScript
for...of vs for...in: Which Loop for Which Job Level: Beginner

for...of gives you the values of an array. for...in gives you the keys of an object, as strings. Mix them up and you get indexes instead of items, or worse.

JavaScript
Fix a Const Assignment Error in a Browser Filter Level: Beginner

Trace a const reassignment inside an input handler, preserve the original list, and verify that filtering and clearing the query both work.

JavaScript
Template Literals: Stop Gluing Strings With + Level: Beginner

Backticks and ${} replace most string gluing with +. You get readable text, values inside it, and multi-line strings without \n everywhere.

JavaScript
Reading "Uncaught TypeError" Without Panicking Level: Beginner

"Uncaught TypeError: Cannot read properties of undefined" means you used a value that wasn't there.

JavaScript
JavaScript Classes With Getters and Setters Level: Intermediate

Getters compute a value when you read it, so totals never go stale. Setters check a value when you assign it, so a negative price throws instead of saving.

JavaScript
Why Your Date Is Off by One Day Level: Intermediate

Your date moves a day because one part of the code uses UTC and another uses local time.

JavaScript
Destructuring Function Parameters With Defaults Level: Intermediate

Replace long lists of positional arguments with one options object, destructured in the parameter list with defaults.

JavaScript
Fix "Cannot use import statement outside a module" Level: Intermediate

The file was loaded as a classic script or CommonJS, where import isn't allowed. The fix in the browser is type="module".