JAVASCRIPT COMPLETE NOTES (Exam-Style, Simple Language)
1. Introduction to JavaScript
JavaScript is a programming language used to make web pages interactive. It runs in browsers and on
servers using [Link].
2. Variables
var – old (avoid), function-scoped
let – modern, block-scoped
const – constant value
3. Data Types
Primitive: String, Number, Boolean, Null, Undefined, Symbol, BigInt
Non-Primitive: Object, Array, Function, Date, Map, Set
4. Operators
Arithmetic (+, -, *, /), Comparison (==, ===), Logical (&&, ||), Ternary, Assignment.
5. Conditions
if/else, switch
6. Loops
for, while, do-while, for-of, for-in
7. Functions
Declaration, Expression, Arrow Functions, Default Parameters
8. Arrays
Methods: push, pop, shift, unshift, slice, splice, concat
HOF: map, filter, reduce, find, includes
9. Objects
Key-value pairs. Access via dot or bracket notation.
10. DOM
Selecting → getElementById, querySelector
Manipulation → innerText, innerHTML, style
Events → addEventListener
11. ES6 Features
Template literals, destructuring, spread, rest, modules
12. Callbacks
Function passed inside another function.
13. Promises
.then(), .catch(), states: pending, resolved, rejected
14. Async/Await
Cleaner way to use promises.
15. Fetch API
Fetching data from API using fetch() with promises or async/await.
16. Error Handling
try, catch, finally
17. Local Storage
setItem, getItem, removeItem
18. JSON
[Link](), [Link]()
19. Hoisting
Variable declarations moved to top of scope.
20. Closures
Inner function accessing outer function variables.
21. OOP
Classes, constructor, inheritance
22. Built-in Objects
Math, Date, String, Array, Map, Set