Starting my JavaScript learning journey — sharing what I learn every day. 🚀 📅 JavaScript Learning Journey — Day 4 Today I learned one of the most important fundamentals in JavaScript — Variables. Variables are used to store data so we can use and manipulate it later in our code. 🔎 What is a Variable? A variable is like a container that holds a value. 💡 Example: let name = "Redoan"; console.log(name); 🧠 Types of Variables in JavaScript There are 3 ways to declare variables: 1️⃣ var (Old way) var age = 20; 2️⃣ let (Modern & recommended) let city = "Dhaka"; 3️⃣ const (Constant value) const country = "Bangladesh"; ⚠️ Difference (Important) • "var" → can be re-declared & has function scope • "let" → can be updated but not re-declared • "const" → cannot be updated or re-declared 📌 Rules for naming variables • Cannot start with number • No spaces allowed • Use meaningful names (best practice) 📌 Key Takeaways (Day 4) • Variables store data • Use "let" and "const" in modern JavaScript • Avoid using "var" in most cases This is Day 4 of my JavaScript learning series. Next, I’ll explore Data Types in JavaScript. #JavaScript #WebDevelopment #FrontendDeveloper #LearningInPublic #100DaysOfCode #programinghero
JavaScript Variables Fundamentals
More Relevant Posts
-
Starting my JavaScript learning journey — sharing what I learn every day. 🚀 📅 JavaScript Learning Journey — Day 8 Today I learned about Loops in JavaScript — a powerful way to repeat tasks efficiently. Loops help us execute the same block of code multiple times without writing it again and again. --- 🔎 1. for Loop (Most Used) for (let i = 1; i <= 5; i++) { console.log(i); } 👉 Output: 1 2 3 4 5 --- 🔎 2. while Loop let i = 1; while (i <= 5) { console.log(i); i++; } --- 🔎 3. do...while Loop let i = 1; do { console.log(i); i++; } while (i <= 5); --- 🧠 When to use what? • "for" → when you know how many times to loop • "while" → when condition-based loop • "do...while" → runs at least once --- 📌 Key Takeaways (Day 8) • Loops reduce repetitive code • "for" loop is most commonly used • Always be careful with infinite loops ⚠️ --- This is Day 8 of my JavaScript learning series. Next, I’ll explore Functions in JavaScript. #JavaScript #WebDevelopment #FrontendDeveloper #LearningInPublic #100DaysOfCode
To view or add a comment, sign in
-
-
Starting my JavaScript learning journey — sharing what I learn every day. 🚀 📅 JavaScript Learning Journey — Day 7 Today I learned about Conditions in JavaScript — how to make decisions in code. Conditions allow us to run different code based on different situations. --- 🔎 1. if Statement let age = 18; if (age >= 18) { console.log("You are an adult"); } --- 🔎 2. if...else let age = 16; if (age >= 18) { console.log("Adult"); } else { console.log("Not adult"); } --- 🔎 3. else if let marks = 75; if (marks >= 80) { console.log("A+"); } else if (marks >= 70) { console.log("A"); } else { console.log("B"); } --- 🔎 4. switch Statement let day = 2; switch(day) { case 1: console.log("Sunday"); break; case 2: console.log("Monday"); break; default: console.log("Invalid day"); } --- 📌 Key Takeaways (Day 7) • Conditions help make decisions • "if", "else", "else if" are most commonly used • "switch" is useful for multiple conditions --- This is Day 7 of my JavaScript learning series. Next, I’ll explore Loops in JavaScript. #JavaScript #WebDevelopment #FrontendDeveloper #LearningInPublic #100DaysOfCode
To view or add a comment, sign in
-
-
Starting my JavaScript learning journey — sharing what I learn every day. 🚀 📅 JavaScript Learning Journey — Day 6 Today I explored Operators in JavaScript — essential for performing operations on data. Operators help us calculate, compare, and make decisions in our code. --- 🔎 Types of Operators in JavaScript ➕ 1. Arithmetic Operators Used for basic math operations: let a = 10; let b = 5; console.log(a + b); // 15 console.log(a - b); // 5 console.log(a * b); // 50 console.log(a / b); // 2 --- ⚖️ 2. Comparison Operators Used to compare values: console.log(10 == "10"); // true console.log(10 === "10"); // false console.log(5 > 3); // true 💡 "==" vs "===" (Important) • "==" → only value compare করে • "===" → value + type compare করে (recommended ✅) --- 🔗 3. Logical Operators Used for decision making: console.log(true && false); // false console.log(true || false); // true console.log(!true); // false --- 📌 Key Takeaways (Day 6) • Operators are used to perform operations • Arithmetic → calculations • Comparison → checking values • Logical → decision making • Always prefer "===" over "==" --- This is Day 6 of my JavaScript learning series. Next, I’ll explore Conditions (if, else, switch). #JavaScript #WebDevelopment #FrontendDeveloper #LearningInPublic #100DaysOfCode
To view or add a comment, sign in
-
-
Day 2 of My JavaScript Learning Journey Today I explored some fundamental concepts that helped me understand how decision-making works in JavaScript and how code execution actually flows. Understanding if vs if-else - "if" always checks its condition independently. - Multiple "if" statements will all run if their conditions are true. - "else" does NOT take a condition — it only runs when the previous "if" is false. Example insight: If we write multiple "if" statements like this: let marks = 85; if(marks > 90){ console.log("O"); } if(marks > 80){ console.log("A"); } if(marks > 60){ console.log("C"); } else { console.log("FAIL"); } Output: A C Why? Because each "if" runs separately and checks its own condition. --- Important Learning If you want ONLY one condition to run, use: if...else if...else Otherwise, multiple outputs will come. --- Semicolon in JavaScript - Semicolon (";") is optional in many cases. - JavaScript automatically inserts it (ASI – Automatic Semicolon Insertion). But: - It becomes important when writing multiple statements in one line. Example: console.log("2"); console.log("nifty"); #JavaScript #WebDevelopment #CodingJourney #LearningInPublic #Day2
To view or add a comment, sign in
-
Starting my JavaScript learning journey — sharing what I learn every day. 🚀 📅 JavaScript Learning Journey — Day 5 Today I learned about Data Types in JavaScript — one of the core concepts every developer must understand. Data types define what kind of value a variable holds. 🔎 Main Data Types in JavaScript 🔹 Primitive Data Types • String → Text let name = "Redoan"; • Number → Numeric value let age = 20; • Boolean → true / false let isStudent = true; • Undefined → value not assigned let x; • Null → intentionally empty let y = null; --- 🔸 Non-Primitive Data Type • Object → collection of data let user = { name: "Redoan", age: 20 }; --- 🧠 Check Data Type using "typeof" console.log(typeof "Hello"); // string console.log(typeof 100); // number console.log(typeof true); // boolean ⚠️ Interesting Fact 😲 console.log(typeof null); // object (this is a known bug in JavaScript) --- 📌 Key Takeaways (Day 5) • Data types define the type of value • Primitive vs Non-Primitive • "typeof" is useful to check types • JavaScript is dynamically typed This is Day 5 of my JavaScript learning series. Next, I’ll explore Operators in JavaScript. #JavaScript #WebDevelopment #FrontendDeveloper #LearningInPublic #100DaysOfCode #programinghero
To view or add a comment, sign in
-
-
🚀 Day 14 of My JavaScript Learning Journey Today I learned about JavaScript Objects — Access, Add, Update & Delete properties. 📌 Key concepts I explored: 🔹 What is an Object? • A collection of key-value pairs • Used to store structured data Example: let user = { name: "Sanjay", age: 21 }; 🔹 Accessing Object Data • Dot Notation → user.name • Bracket Notation → user["age"] 💡 Bracket notation is useful when keys are dynamic or contain special characters. 🔹 Modifying Objects • Add → user.city = "Bangalore" • Update → user.age = 22 🔹 Deleting Properties • Use delete keyword Example: delete user.city; 🔹 Important Insight • Objects are mutable, meaning they can be changed after creation 💡 Understanding objects is essential because they are widely used to represent real-world data in applications. Step by step, I’m improving my JavaScript fundamentals and practical coding skills. 💻✨ #JavaScript #WebDevelopment #FrontendDevelopment #CodingJourney #LearningInPublic #100DaysOfCode #DeveloperJourney #ProgrammingBasics
To view or add a comment, sign in
-
-
🚀 Day 10 of My JavaScript Learning Journey Today I explored JavaScript Functions — the core building blocks of any application. 📌 Key concepts I learned: 🔹 Types of Functions • Named Functions – Functions with a defined name • Anonymous Functions – Functions without a name, often used for one-time use • Arrow Functions (=>) – Modern and concise syntax 🔹 Function Expressions • Functions can be assigned to variables and treated like data 🔹 Advanced Concepts • First-Class Functions – Functions can be passed as arguments and returned from other functions • Higher-Order Functions – Functions that work with other functions • IIFE (Immediately Invoked Function Expression) – Executes immediately after definition 🔹 Scope & Closures • Nested Functions create scope within scope • Important for managing variables and data access 🔹 Generators • Functions that allow pausable execution using yield ⚙️ Understanding functions is crucial because they help write modular, reusable, and efficient code. Step by step, I’m building strong JavaScript fundamentals and problem-solving skills. 💻✨ #JavaScript #WebDevelopment #FrontendDevelopment #CodingJourney #LearningInPublic #DeveloperJourney #ProgrammingBasics
To view or add a comment, sign in
-
-
🚀 Day 12 of My JavaScript Learning Journey Today I learned about Arrays and Array Methods in JavaScript — one of the most essential concepts for handling data. 📌 What I learned: 🔹 What is an Array? • A collection of elements stored in a single variable • Zero-indexed (starts from 0) 🔹 Ways to Create an Array • Using array literal → [1, 2, 3] • Using constructor → new Array() 🔹 Adding & Removing Elements • push() / unshift() → Add elements • pop() / shift() → Remove elements 🔹 Important Array Methods • map() → Transform elements • filter() → Select specific elements • reduce() → Convert array into a single value 🔹 Searching & Utility Methods • find() / includes() • forEach() → Iterate elements • slice() / splice() → Extract or modify array 💡 Arrays are powerful because they allow us to store, manipulate, and process data efficiently. ⚙️ I also practiced real examples like transforming arrays using map() to create new values. Step by step, I’m improving my problem-solving skills and JavaScript fundamentals. 💻✨ #JavaScript #WebDevelopment #FrontendDevelopment #CodingJourney #LearningInPublic #100DaysOfCode #DeveloperJourney #ProgrammingBasics
To view or add a comment, sign in
-
-
🚀 Day 3 of My JavaScript Learning Journey Today I explored some core concepts of JavaScript that every beginner must understand — and honestly, things are starting to make more sense now! 🔢 1. Numbers in JavaScript JavaScript has only one type for numbers — no separate integer or float. Example: 10 / 20 = 0.5 Even though both are integers, the output is a decimal. Simple but powerful! ✅ 2. Boolean Logic Understanding true/false conditions: 3 >= 3 → true 2 >= 3 → false Also learned something interesting 👇 Expressions are evaluated left to right: 1 >= 0 <= 5 < 6 >= 0 → true 🔄 3. Typecasting == → checks only value === → checks value + type This small difference can save you from big bugs! ⚡ 4. Logical Operators & Short Circuiting || (OR) → if any condition is true && (AND) → all conditions must be true ! (NOT) → reverses the result 👉 Short Circuiting: As soon as JavaScript gets the result, it stops checking further. Example: let marks = 45; let attendance = 60; if (marks >= 33 || attendance >= 75) { console.log("You are pass"); } else { console.log("Fail"); } 💡 Even if one condition is true, it won’t check the next! 🧵 5. Strings & Template Literals Instead of messy concatenation, we can use template literals: let naam = "Surbhi"; let kaam = "Web Developer"; let shaher = "Gurgaon"; let output = `Hi, I am ${naam}, a ${kaam} in ${shaher}`; Clean, readable, and modern ✨ 📌 Small steps every day… but building strong foundations! #javascript #codingjourney #webdevelopment #learninginpublic
To view or add a comment, sign in
-
Day 07 of My JavaScript Learning 👉 Finding the largest among three numbers How to compare multiple values using if-else Writing clean and readable conditions Converting logic into a reusable function // Find the largest among 3 numbers let firstNum = 5; let secondNum = 10; let thirdNum = 2; if (firstNum >= secondNum && firstNum >= thirdNum) { console.log(firstNum); } else if (secondNum >= firstNum && secondNum >= thirdNum) { console.log(secondNum); } else { console.log(thirdNum); } 🔁 Making it reusable with a function: let largestInFunction = function(firstNum, secondNum, thirdNum) { if (firstNum >= secondNum && firstNum >= thirdNum) { return firstNum; } else if (secondNum >= firstNum && secondNum >= thirdNum) { return secondNum; } else { return thirdNum; } } console.log(largestInFunction(3, 1, 4)); 🌱 My takeaway: Even simple problems help build strong fundamentals. The goal is not just solving — but understanding the logic behind it. #Day07 #JavaScript #LearningJourney #FrontendDeveloper #CodingPractice
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development