🟨 𝗩𝗮𝗿, 𝗹𝗲𝘁, 𝗰𝗼𝗻𝘀𝘁 — 𝘁𝗵𝗲𝘆’𝗿𝗲 𝗻𝗼𝘁 𝘁𝗵𝗲 𝘀𝗮𝗺𝗲 JavaScript offers three ways to declare variables, but they behave very differently. `var` 🔁 function-scoped ⚠️ can be redeclared `let` 📦 block-scoped 🔄 can be reassigned `const` 🔒 block-scoped ❌ cannot be reassigned 𝗖𝗵𝗼𝗼𝘀𝗶𝗻𝗴 𝘁𝗵𝗲 𝗿𝗶𝗴𝗵𝘁 𝗸𝗲𝘆𝘄𝗼𝗿𝗱 𝗽𝗿𝗲𝘃𝗲𝗻𝘁𝘀 𝗵𝗶𝗱𝗱𝗲𝗻 𝗯𝘂𝗴𝘀. #JavaScript #Programming #LearningInPublic #ITStudent
JavaScript variable declaration: var, let, const differences
More Relevant Posts
-
🟨 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗶𝘀 𝘀𝗶𝗻𝗴𝗹𝗲-𝘁𝗵𝗿𝗲𝗮𝗱𝗲𝗱 — 𝘀𝗼 𝗵𝗼𝘄 𝗱𝗼𝗲𝘀 𝗶𝘁 𝗵𝗮𝗻𝗱𝗹𝗲 𝗮𝘀𝘆𝗻𝗰 𝘁𝗮𝘀𝗸𝘀? JavaScript runs on **one main thread**. Yet it can handle things like: 🌐 network requests ⏳ timers 📦 user interactions The secret is the **Event Loop**. It manages: • Call Stack • Task Queue • Callback execution So while one task runs, others wait in the queue. 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗶𝘀𝗻’𝘁 𝗽𝗮𝗿𝗮𝗹𝗹𝗲𝗹 — 𝗶𝘁’𝘀 𝘀𝗺𝗮𝗿𝘁𝗹𝘆 𝗼𝗿𝗴𝗮𝗻𝗶𝘇𝗲𝗱. #JavaScript #Programming #LearningInPublic #ITStudent
To view or add a comment, sign in
-
-
Day 6 of “Js in bits series – (Datatypes - Boolean)” In this article, I cover: 🔹 What the Boolean datatype is 🔹 How JavaScript uses true/false in conditions 🔹 Examples with comparisons and logical checks 🔹 Why Boolean values are essential for decision-making in programs 👉 https://lnkd.in/gc-H6ky9 #javascript #webdevelopment #frontend #programming #softwareengineering #learning
To view or add a comment, sign in
-
-
Mastering JavaScript Loops: A Comprehensive Guide Loops are fundamental constructs in programming, allowing you to execute a block of code repeatedly. This tutorial dives deep into all types of loops in JavaScript, explaining their syntax, use cases, and best practices with practical code examples. Learn to choose the right loop for every scenario. Read the full article 👇 https://lnkd.in/dM2U38MH #Technology #Programming #WebDevelopment #SoftwareEngineering #JavaScript #JSLoops #CodingTips #FrontendDevelopment #FutureOfWork #DigitalTransformation
To view or add a comment, sign in
-
-
🌌 What if JavaScript variables were books in a library? Some books can be rewritten. Some are locked forever. Some are shared by many readers. And some quietly disappear when no one remembers them. That’s surprisingly close to how JavaScript variables and memory actually work. I explored this idea through a short story inspired by The Midnight Library. 📖 Read the blog:https://lnkd.in/g46v5jfp #JavaScript #Programming #LearnInPublic #chaicode Hitesh Choudhary Piyush Garg Akash Kadlag
To view or add a comment, sign in
-
Revisiting a simple but powerful JavaScript concept today: map() map() allows us to transform each element of an array and return a new array. Example: doubling numbers in an array. Small concepts like these form the foundation of writing cleaner and more functional JavaScript code. #JavaScript #WebDevelopment #FrontendDevelopment #Programming #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
-
Mastering 'this' in JavaScript: A Comprehensive Guide to Context The 'this' keyword in JavaScript is notorious for its complexity and the confusion it often causes. This tutorial demystifies 'this', exploring its various contexts, common pitfalls, and how to control its value using 'call', 'apply', and 'bind' for robust application development. Read the full article 👇 https://lnkd.in/dtZbsgAB #JavaScript #Programming #WebDevelopment #Coding #Tech #thisKeyword #JavaScriptThis #FunctionBinding #CallApplyBind #ContextInJS #FutureOfWork #DigitalTransformation
To view or add a comment, sign in
-
-
30 Days JavaScript Challenge : Day 17 ✅ Today’s problem was about designing a Time Limited Cache. The idea was to store key-value pairs, but with a twist each key should expire after a certain time. The class needed to support: • setting values with an expiry • retrieving values only if they’re still valid • counting how many keys are currently active This felt closer to a real-world problem, especially how caching systems work with expiration. It was interesting to think about how to manage time, state, and updates together in a clean way. 17 days in learning not just syntax, but how to think through problems. 💻🚀 #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic
To view or add a comment, sign in
-
-
🚀 JavaScript Fundamentals Series — Part 3 Programs are not just instructions. They are decisions. This is where control flow comes in. In this guide I explain: • if / else conditions • switch statements • for loops • while loops • Writing readable logic Once you understand control flow, you can finally start writing real programs instead of simple scripts. Full guide 👇 https://lnkd.in/d8wkkNbF #javascript #programming #webdev
To view or add a comment, sign in
-
In JavaScript, Reference Data Types say: “If you change me… I will change the every refrences of yours. 😏 Sounds dramatic? Look at this 👇 let a = [1, 2, 3, 4]; let b = a; b.pop(); console.log(a); console.log(b); comment down the output?? #javascript #coding #learntocode #programming #datatypes #learninginpublic
To view or add a comment, sign in
-
In my previous post, I shared Method 1 of implementing a simple login and logout system using JavaScript. In the next post, I will share Method 2, where I’ll explain a different approach and also highlight the key differences between both methods. Stay tuned to see how the second method works and how it improves the functionality. Method 2 – Coming Soon. #WebDevelopment #JavaScript #FrontendDevelopment #Programming #Coding #SoftwareDevelopment #WebDeveloper #DeveloperLife #TechCommunity #LearnToCode #CodingJourney #WomenInTech Javeria Naz Dpoxy Logics
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