22 posts
javascript
Notes on closures, after the fourth try1 min readEvery time I think I get it, JavaScript hands me another shape. This is the version that finally stuck.Mastering the forEach Loop: A Friendly Guide2 min readThe forEach method is the cleanest way to loop through arrays in JavaScript. Learn its syntax and see how it compares to for and for...of loops.Mastering the Art of Loops: Running Code Efficiently2 min readUse for loops to run code multiple times efficiently. Learn the anatomy of a for loop, how to loop through arrays, and how to avoid infinite loops.Mastering Array Methods2 min readLearn the most useful array methods in JavaScript: indexOf, push, pop, shift, unshift, splice, and slice for finding, adding, and removing items.Intro to Array2 min readArrays are lists of data in JavaScript. Learn how to create arrays, access items by index, check length, and modify values.Callback2 min readA callback is a function passed to another function to run later. Learn what callbacks are, why they're useful, and how JavaScript's event loop works.Changing Classes1 min readAdd, remove, toggle, and check CSS classes on DOM elements using the classList API to let CSS handle styling from JavaScript.Listening to Events2 min readLearn how to use addEventListener to respond to user actions like clicks and key presses, and how to change the DOM with event listeners.Selecting an Element2 min readUse querySelector and querySelectorAll to select DOM elements with CSS-style selectors. Target elements by id, class, tag, and attribute.BOM and DOM2 min readLearn the difference between the Browser Object Model (BOM) and the Document Object Model (DOM), and how to access them in JavaScript.Null and Undefined2 min readUnderstand the difference between null and undefined in JavaScript — two distinct primitives that both represent the absence of a value.Not Operator2 min readThe ! operator inverts truthy and falsy values. Learn how to use NOT and double negation to write cleaner conditional logic in JavaScript.If / Else Statements2 min readControl your program's flow with if/else statements. Learn comparison operators, truthy/falsy values, and how to make decisions in JavaScript.Object2 min readJavaScript objects store key-value pairs. Learn to access properties with dot and bracket notation, set and delete values, and use functions as methods.Arrow Function2 min readLearn JavaScript arrow functions for concise syntax. Use => instead of function, with variations for arguments and implicit returns for cleaner code.Function2 min readLearn JavaScript functions: declaring, using them, handling parameters, return values, and hoisting for organized, reusable code.Declare Variable2 min readLearn to declare variables in JavaScript to make code meaningful and manageable. Use const for fixed values and let for mutable ones, avoiding var.Basic Data Types2 min readExplore JavaScript's basic data types: String, Number, Boolean, Null, Undefined, Symbol, and BigInt. Learn how they impact values and operations.Semicolons2 min readLearn about semicolons in JavaScript, including how automatic insertion works and the impact on code readability.Comments2 min readUnderstand JavaScript comments with // for single-line and /* */ for multi-line notes. Comments help document and explain your code.Console2 min readExplore the browser console for running JavaScript, debugging code, and handling errors. Learn to open the console, execute commands, and view output.Linking JavaScript file2 min readLearn how to link JavaScript files to HTML, including naming practices, correct use of the script tag, and the differences between relative and absolute paths.