Skip to content
blog
17 posts

Basic Programming in JavaScript

1. 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.2. Console2 min readExplore the browser console for running JavaScript, debugging code, and handling errors. Learn to open the console, execute commands, and view output.3. Comments2 min readUnderstand JavaScript comments with // for single-line and /* */ for multi-line notes. Comments help document and explain your code.4. Semicolons2 min readLearn about semicolons in JavaScript, including how automatic insertion works and the impact on code readability.5. 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.6. 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.7. Function2 min readLearn JavaScript functions: declaring, using them, handling parameters, return values, and hoisting for organized, reusable code.8. Arrow Function2 min readLearn JavaScript arrow functions for concise syntax. Use => instead of function, with variations for arguments and implicit returns for cleaner code.9. 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.10. 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.11. 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.12. Null and Undefined2 min readUnderstand the difference between null and undefined in JavaScript — two distinct primitives that both represent the absence of a value.13. 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.14. Selecting an Element2 min readUse querySelector and querySelectorAll to select DOM elements with CSS-style selectors. Target elements by id, class, tag, and attribute.15. Changing Classes1 min readAdd, remove, toggle, and check CSS classes on DOM elements using the classList API to let CSS handle styling from JavaScript.16. 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.17. 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.