Intro to Programming in JavaScript - Full Class Notes
Date: November 10, 2025
Topic: JavaScript Core Concepts and Applications
JavaScript is a dynamically typed, interpreted programming language used to make web pages
interactive. Based on ECMAScript standards (ES6+).
Variables: Declared with var, let, const. let and const have block scope; const prevents reassignment.
Primitive types: string, number, boolean, null, undefined, symbol, bigint.
Complex types: Object, Array, Function, Date, RegExp.
Operators: Arithmetic, logical, comparison, and assignment operators. '===' checks value and type
equality.
Functions: Can be declared, expressed, or written as arrow functions.
Example: function add(a,b){return a+b;} or const add=(a,b)=>a+b;
Control flow: if/else, switch, for, while, do-while.
Example: for(let i=0;i<10;i++){[Link](i);}
Objects: key-value data structures. Access with dot or bracket notation.
Arrays: support methods like push(), pop(), map(), filter(), reduce().
Example: const doubled = [Link](x => x*2);
DOM (Document Object Model): JS manipulates web pages via [Link](), innerText,
and event listeners.
Example: [Link]('#btn').addEventListener('click',()=>alert('Clicked!'));
Asynchronous JS: Uses callbacks, Promises, and async/await for non-blocking operations.
Example: async function fetchData(){let res=await fetch(url);return await [Link]();}
JSON (JavaScript Object Notation): lightweight data format for APIs.
Example: [Link](obj), [Link](jsonStr).
Modules: enable code reuse. Example: export function greet(){} and import {greet} from './[Link]';
Error handling: try...catch for runtime errors.
Prototypes and inheritance: Objects inherit properties via prototype chain.
Classes: syntactic sugar for constructor functions.
Example: class Car{constructor(model){[Link]=model;}}
Reference: MDN JavaScript Guide.
Advanced: Closures (functions with preserved scope), event loop, and memory management (garbage
collection).