JavaScript Visual Notes: Beginner to
Advanced
Introduction
JavaScript is a powerful scripting language used to make web pages dynamic and interactive.
Basics
Variables
let and const are block-scoped, while var is function-scoped.
Example:
let name = "Alice";
const pi = 3.14;
Data Types
String, Number, Boolean, Object, Array, Null, Undefined.
Functions
Functions let you reuse logic and keep code organized.
Example:
function add(a, b) { return a + b; }
DOM Manipulation
You can modify HTML elements using JavaScript.
Example:
[Link]("demo").innerText = "Hello!";
Intermediate
Arrays & Methods
JavaScript offers methods like map, filter, reduce.
Example:
[1,2,3].map(n => n*2);
Objects
Objects store data in key-value pairs.
Example:
let person = {name: "Bob", age: 25};
Asynchronous JS
JavaScript uses callbacks, Promises, and async/await for async operations.
Example:
async function fetchData(){ let res = await fetch("url"); }
Advanced
Closures
A closure remembers its outer scope variables.
Prototypes
JavaScript uses prototypal inheritance.
Modules
You can split code into modules using export/import.
Projects
To■Do App
Features: Add, delete, mark tasks as complete.
Weather App
Uses API to fetch real-time weather.
Calculator
Basic arithmetic operations.
Quick Reference Table
Topic Description
Variables Store data
Functions Reusable logic blocks
DOM Manipulates web page