JavaScript Basics - Day 1
What is JavaScript, Variables, Data
Types, Operators, Conditionals, Loops
What is JavaScript?
• A scripting language for the web
• Runs in browser (Client-side)
• Makes websites interactive
• Example: sliders, form validation, dynamic
content
How JS Works
• Embedded in HTML using <script>
• Executes top to bottom
• Can manipulate HTML/CSS (DOM)
Variables
1. Containers for storing data
2. Declared using var, let, const
3. Example: let name = "Your Name";
Data Types
1. String: "Hello"
2. Number: 5, 3.14
3. Boolean: true, false
Operators
1. Arithmetic: +, -, *, /
2. Comparison: ==, !=, ===, <, >
3. Logical: &&, ||, !
Conditionals
if (age > 18) {
[Link]("Adult");
} else {
[Link]("Minor");
}