Week 4: Feb 16 - Feb 22, 2026
Unit II: JavaScript Advanced — Scope, Objects & DOM
Week Overview
This week advances your JavaScript skills with block-scoped variables, objects and object literals, DOM manipulation, array methods, and a practical revision session.
Course Outcome: CO-2 (K3 - Application)
Duration: 1 week (4 lectures + 1 lab)
Lab: JavaScript Functions & Events
Lecture 13: Block Scope Variables (let, const)
var vs let vs const
Block Scope in Action
Template Literals (ES6)
Destructuring & Spread
Lecture 14: Objects & Object Literals in JavaScript
Object Literal Syntax
Accessing & Modifying Properties
Nested Objects
this Keyword
Lecture 15: DOM Manipulation & Array Methods
DOM Selection
DOM Manipulation
Creating & Removing Elements
Array Methods
Lecture 16: Revision & Practical (JavaScript + DOM)
Interactive Task List (Combining It All)
const input = document.querySelector('#taskInput');
const list = document.querySelector('#taskList');
document.querySelector('#addBtn').addEventListener('click', () => {
if (!input.value.trim()) return;
const li = document.createElement('li');
li.textContent = input.value;
li.addEventListener('click', () => li.classList.toggle('done'));
list.appendChild(li);
input.value = '';
});Revision Checklist
Lab 4: JavaScript Array Methods and Nested Functions
Objectives
- Apply array methods (
map,filter,reduce) to real data - Practice nested functions and closures
- Combine DOM manipulation with event handling
Activities
- Create an array of student objects and use
mapto render them in a table - Add a search input that
filters the rendered list in real time - Use
reduceto calculate a total (e.g., average marks) - Implement a counter using closures
- Commit all work to GitHub
Deliverables
- HTML + JS file with array methods and DOM updates
- Working search/filter functionality
- GitHub commit with changes
Key Takeaways
✅ const / let are block-scoped; prefer them over var
✅ Objects group related data and behaviour in key-value pairs
✅ DOM manipulation lets JavaScript change live HTML content
✅ Array methods (map, filter, reduce) enable concise data processing
✅ Combine scope, objects, DOM, and events to build interactive UI components
Next Week
Unit III: Java Servlet Programming (Server-Side Web): - Lecture 17: Servlet Overview & Architecture - Lecture 18: Servlet Interface & Life Cycle - Lecture 19: Handling HTTP GET & POST Requests - Lecture 20: Redirecting Requests & Request Dispatching