Basic 2.5 hours Programming Languages
Introduction to JavaScript
Master JavaScript fundamentals β variables, functions, DOM basics, and ES6+ features. Structured tutorial with MCQs and coding practice.
Learning Outcomes
- Understand JavaScript syntax and execution model
- Work with variables, functions, and arrays
- Manipulate the DOM in the browser
- Use modern ES6+ features like arrow functions and destructuring
Learning Outcomes
Learn JavaScript from scratch β the language that powers the web. Covers fundamentals through modern ES6+ syntax.
Basic Level
// Variables and constants
let name = "LEARNCODEGURU";
const year = 2026;
console.log(`Welcome to ${name} β ${year}`);
// Function
function add(a, b) {
return a + b;
}
Advanced Level
// Arrow functions & destructuring
const users = [{ name: "Alice", score: 95 }, { name: "Bob", score: 87 }];
const topScorer = users.reduce((max, u) => u.score > max.score ? u : max);
console.log(topScorer.name);
Interview Level
Q: What is the difference between var, let, and const?
var is function-scoped and hoisted; let and const are block-scoped. const cannot be reassigned.
Q: Explain closures in JavaScript. A closure gives a function access to its outer scopeβs variables even after the outer function has returned.
Application Level
Build an interactive todo list that adds, removes, and marks tasks complete using DOM manipulation.
MCQs
- Which method adds an element to the end of an array?
- A)
push()B)pop()C)shift()D)unshift() - Answer: A
- A)
Practice Programs
- Reverse a string without using built-in reverse.
- Find the largest number in an array.
- Create a simple counter with increment/decrement buttons.
Project Ideas
- Weather App β Fetch data from a public API
- Quiz App β Multiple choice questions with score tracking
- Expense Tracker β Add, list, and sum expenses