■ Introduction to JavaScript
A Beginner’s Course
Module 1: Getting Started with JavaScript
What is JavaScript?
History and evolution of JavaScript.
How JavaScript works with HTML and CSS.
Adding JavaScript to a webpage.
Running JS in browsers and developer console.
Example:
console.log('Hello World!');
Exercise: Open your browser console and print a message.
Module 2: Variables and Data Types
Variables: var, let, const.
Primitive Data Types: Strings, Numbers, Booleans, Null, Undefined.
Composite Data Types: Arrays and Objects.
Example:
let name = 'Leonard';
let colors = ['red','blue','green'];
let person = {first_name:'Leonard', age:40};
Exercise: Create an object for yourself and print details.
Module 3: Operators
Arithmetic Operators: +, -, *, /
Comparison Operators: == vs ===
Logical Operators: &&, ||, !
Example:
let a=10, b=5; console.log(a+b);
Exercise: Check if a number is >10 and <50.
Module 4: Control Structures
Loops: for, while.
Conditional Statements: if-else, else if, switch.
Examples with arrays and grading system.
Exercise: Write a program that checks if a number is even or odd.
Module 5: Functions
Defining functions and calling them.
Parameters and return values.
Arrow functions.
Example:
function greet(name){ return 'Hello ' + name; }
Exercise: Write a function that returns the average of two numbers.
Module 6: Debugging & Best Practices
Use console.log() for debugging.
Understand error messages.
Prefer let/const over var.
Use === instead of ==
Module 7: Practical Mini-Projects
BMI Calculator.
Grade Calculator.
Day Finder App.
Module 8: Next Steps in JavaScript
DOM Manipulation.
Events.
ES6+ Features.
Frameworks (React, Vue, Angular).
Backend with Node.js.