🚀 JavaScript Basics, I Practiced Today As I continue learning JavaScript, today I practiced some important fundamentals that every beginner should understand. These small concepts are the building blocks of real web applications. 1️⃣ var, let, const These are used to declare variables in JavaScript. Example: var name = "Amit"; let age = 22; const country = "Bangladesh"; console.log(name); console.log(age); console.log(country); Difference- var, let and const: • var → Old way of declaring variables. • let → Value can be changed. • const → Value cannot be changed. Example: let score = 10 let score = 20 // allowed ( // this is a comment tag). const pi = 3.14; // const pi = 3.15 ❌ not allowed. 2️⃣ JavaScript Data Types: Data types tell us what type of value a variable stores. JavaScript has two main types of data: 1️⃣ Primitive Data Types 2️⃣ Non-Primitive Data Types 🟢 Primitive Data Types Primitive values are simple and store a single value. Examples: • String: let name = "Amit"; console.log(name); • Number: let age = 22 • Boolean: Boolean valu is true or false. let isStudent = true; • Undefined: Not define any value. let city; console.log(city); • Null let data = null; 🟢 Non-Primitive Data Types: Non-primitive types can store multiple values. Examples: • Object let user = { name: "Amit", age: 22 } console.log(user.name) • Array: let skills = ["HTML", "CSS", "JavaScript"]; console.log(skills[0]); 💡 My Learning Insight Understanding variables and data types is essential before moving to advanced topics like DOM manipulation, APIs, and React. I believe the best way to learn programming is by building projects and practicing daily. Currently working toward becoming a MERN Stack Developer. 💬 What JavaScript concept should I learn next? #javascript #webdevelopment #frontenddeveloper #learninginpublic #mern
JavaScript Basics: Variables and Data Types
More Relevant Posts
-
I recently published a blog on “Understanding Variables and Data Types in JavaScript.” For many beginners, JavaScript frameworks look exciting, but the real strength of a developer comes from strong fundamentals. In this blog, I explain: 1. What variables are and why they are needed 2. How to declare variables using var, let, and const 3. Primitive data types (string, number, Boolean, null, undefined) 4. Basic difference between var, let, and const 5. What is scope (very beginner-friendly explanation) If you're starting your web development journey, mastering these basics will make learning advanced concepts much easier. Read the blog here: https://lnkd.in/gkA-AmYj #JavaScript #WebDevelopment #Programming #LearnToCode #SoftwareDevelopment #chaiCodeCohort Hitesh Choudhary Akash Kadlag
To view or add a comment, sign in
-
𝗨𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱𝗶𝗻𝗴 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻 𝗗𝗲𝗰𝗹𝗮𝗿𝗮𝘁𝗶𝗼𝗻𝘀 𝗮𝗻𝗱 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻 𝗘𝘅𝗽𝗿𝗲𝘀𝘀𝗶𝗼𝗻𝘀 When learning JavaScript, you will encounter two important concepts: Function Declarations and Function Expressions. Understanding these concepts is crucial for learning arrow functions, callbacks, and modern JavaScript patterns. Functions are reusable blocks of code that perform a specific task. You can reuse them instead of writing the same code again and again. - They make your programs cleaner and more efficient. - They break large programs into smaller logical parts. - They make your programs easier to manage and update. There are two common ways to define functions in JavaScript: - Function Declaration: defined directly using the function keyword - Function Expression: assigned to a variable Here are the key differences: - Function Declarations are hoisted to the top of their scope, so you can call them before they appear in the code. - Function Declarations always have a name. - Function Expressions are not fully hoisted, so you cannot call them before they are assigned to a variable. - Function Expressions are often anonymous, meaning they don’t have their own name. When to use each type: - Use Function Declarations when you want to call the function before it is defined. - Use Function Expressions when working with events, arrays, or asynchronous code. Understanding Function Declarations and Function Expressions is important because many modern JavaScript concepts depend on them, such as arrow functions, callbacks, and higher-order functions. Source: https://lnkd.in/gxjEeUDC
To view or add a comment, sign in
-
🚀 JavaScript Developer Mastery Guide (2026) Most developers learn JavaScript by memorizing syntax. But the real difference between a junior developer and an experienced engineer is understanding how JavaScript works under the hood. So I created a detailed JavaScript Developer Mastery PDF that explains the core concepts every developer should understand to write scalable applications. Here’s what the guide covers 👇 📦 Phase 1: Memory & Architecture • const, let, var best practices • Stack vs Heap memory • Primitive vs Reference data types ⚙️ Phase 2: The Logic Engine • Type coercion explained • == vs === (why strict equality matters) • Essential Math & String methods ⚡ Phase 3: Structural Flow • Truthy vs Falsy values • for...of vs for...in loops • Cleaner control flow with switch statements 🧠 Phase 4: Functional JavaScript • Hoisting explained • Arrow functions and lexical this • Rest & Spread operators • IIFE pattern for private scope 📊 Phase 5: Data Transformation The three most powerful array methods used in real-world apps: • map() → transform data • filter() → remove unwanted data • reduce() → combine values 🌐 Phase 6: Asynchronous JavaScript • Event Loop concept • Promises • Async / Await The guide also includes practical code examples for every concept, making it easier to understand and apply in real projects. 💡 My biggest learning: Once you truly understand Stack vs Heap, Event Loop, and Array methods, frameworks like React, Next.js, and Node.js become much easier to work with. 📄 I’ve shared the complete PDF guide in this post for developers who want to strengthen their JavaScript fundamentals. If you're learning JavaScript or mentoring juniors, this might help. 💬 Question for developers: Which JavaScript concept took you the longest to fully understand? #JavaScript #WebDevelopment #FrontendDevelopment #Programming #SoftwareEngineering #ReactJS #NextJS #Coding #LearnToCode #DeveloperRoadmap
To view or add a comment, sign in
-
𝗨𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱𝗶𝗻𝗴 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻 𝗗𝗲𝗰𝗹𝗮𝗿𝗮𝘁𝗶𝗼𝗻𝘀 𝗮𝗻𝗱 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻 𝗘𝘅𝗽𝗿𝗲𝘀𝘀𝗶𝗼𝗻𝘀 When learning JavaScript, you will encounter two important concepts: Function Declarations and Function Expressions. Understanding these concepts is crucial for learning arrow functions, callbacks, and modern JavaScript patterns. Functions are reusable blocks of code that perform a specific task. You can reuse them instead of writing the same code multiple times. - They make your programs cleaner and more efficient. - They break large programs into smaller logical parts. - They make your programs easier to manage and update. There are two common ways to define functions in JavaScript: - Function Declaration: defined directly using the function keyword. - Function Expression: assigned to a variable. Here are the key differences: - Function Declarations are hoisted to the top of their scope, so you can call them before they appear in the code. - Function Declarations always have a name. - Function Expressions are not fully hoisted, so you cannot call them before they are assigned to a variable. - Function Expressions are often anonymous, meaning they don’t have their own name. When to use each type: - Use Function Declarations when you want to call the function before it is defined. - Use Function Expressions when working with events, arrays, or asynchronous code. Understanding Function Declarations and Function Expressions is important because many modern JavaScript concepts depend on them, such as arrow functions, callbacks, and higher-order functions. Source: https://lnkd.in/gyY3cNir
To view or add a comment, sign in
-
🚀 Blog 7 of Javascript series: Objects in JS Objects are fundamental non-primitive data types in JS. Here is a beginner-friendly blog article: Link: https://lnkd.in/gAQqwbm2 Hitesh Choudhary Piyush Garg and Chai Aur Code team #javascript #webdevelopment #frontend #coding #jsblogs
To view or add a comment, sign in
-
Day 3 of my JavaScript learning journey. I used to write strings like this in JavaScript: "Hello, " + name + "! You are " + age + " years old." Today I learned there’s a much better way. Template literals instantly made my code cleaner and easier to read. Here’s what I explored today. Template Literals They allow you to embed variables directly inside a string using backticks. `Hello, ${name}! You are ${age} years old.` Much more readable than string concatenation. I also learned a few useful string methods: • slice() → extract part of a string • replace() → replace text inside a string • includes() → check if text exists inside a string • split() → convert a string into an array Example: "hello world".includes("world") This returns true. Another important concept today was operators. Arithmetic operators: + - * / % Comparison operators: > < >= <= But the most important thing I learned today: == vs === 5 == "5" // true 5 === "5" // false == checks value only (JavaScript converts the type). === checks value AND type. So the safer rule is simple: Always use === Day 3 done. Small syntax improvements already make the code much cleaner. What is your most used string method in JavaScript? #JavaScript #LearningInPublic #WebDevelopment #100DaysOfCode #Frontend
To view or add a comment, sign in
-
🚀 Master JavaScript — From Beginner to Advanced A Complete Cheat Sheet Series You'll Bookmark Forever JavaScript is the backbone of the modern web. Whether you're just starting out or levelling up your skills, this 7-page cheat sheet covers everything you need to write clean, powerful JavaScript. What's inside — all in one place: ✅ var / let / const · All 8 Data Types · typeof ✅ Operators — Arithmetic, Comparison, Logical, Ternary, Nullish ✅ Functions — Declaration, Arrow, Default Params, Rest, IIFE ✅ Arrays — push/pop/splice + map · filter · reduce · find · flat ✅ Objects — Spread, Destructuring, Object.keys/values/entries ✅ DOM Manipulation — Select, Create, Modify, Remove Elements ✅ Events · Fetch API · POST requests ✅ Promises · async/await · try/catch · Parallel calls ✅ ES6+ — Template Literals, Classes, Modules, Optional Chaining ✅ Error Handling · Custom Error Classes · All Loop Types `✅ Master Quick Reference — 18 most-used patterns in one table This isn't just theory — every single example is real, runnable code you can drop straight into your project. Works with Browser · Node.js · React · Vue · Angular · Next.js · Deno · Bun Save this post. Share it with someone learning JavaScript. 🔖 💬 Comment "PDF" below and I'll send the full PDF to your DMs — completely free. 👉 Follow @techwithchay for weekly cheat sheets on JavaScript, Python, SQL, System Design and more. New content drops every week. Don't miss it. 🔔 #JavaScript #JavaScriptCheatSheet #WebDevelopment #Frontend #FullStack #NodeJS #ReactJS #LearnJavaScript #ES6 #Programming #CodingTips #100DaysOfCode #TechSkills #DeveloperTools #SoftwareEngineering #TechWithChay #WebDev #JSDevs #CodeNewbie #OpenToWork
To view or add a comment, sign in
-
Day 11 of documenting my journey as a Front-End Developer — Introduction to JavaScript Today, I started learning JavaScript, and I had a big misconception at first—I thought JavaScript was an advanced version of Java. I learned that this is not true. JavaScript and Java are completely different languages. JavaScript was created by Brendan Eich and was originally called Mocha, then LiveScript, before being renamed JavaScript to attract Java developers. JavaScript is a high-level, interpreted programming language mainly used to make websites interactive. One thing that stood out to me is how JavaScript executes code—line by line (synchronously), meaning order matters. I also learned: . JavaScript files are saved as .js (e.g., app.js) . It is linked in HTML using: HTML <script src="app.js"></script> . The defer attribute is used when the script is placed in the <head> to delay execution until the HTML loads Interesting fact: Different browsers use different JavaScript engines: . Chrome ---V8 Engine . Firefox----- SpiderMonkey On comments I understood: . JavaScript uses // for single-line comments . /* */ can also be used (same as CSS) . But HTML comments (<!-- -->) do not work in JavaScript Lesson learned: Understanding the foundation of a language helps clear wrong assumptions before diving deeper. #FrontendDevelopment #JavaScript #WebDevelopment #LearningJourney #BeginnerMistakes #WomenInTech #softwareengineering #developer #learninginpublic #techcommunity #careergrowth
To view or add a comment, sign in
-
-
JavaScript Array Methods, Simplified Want to master arrays in JavaScript but are overwhelmed by all the methods? Here’s a quick breakdown of essential array methods : 1. Add or Remove Items Use .push(), .pop(), .shift(), and .unshift() to modify arrays by adding/removing elements at the beginning or end. 2. Transform and Extract Data Methods like .map(), .filter(), .slice() help reshape arrays, filter elements, or extract portions without changing the original. 3. Search and Identify Values With .indexOf(), .find(), .includes(), and similar methods, you can locate items or check for their presence efficiently. 4. Combine, Loop & Display .forEach(), .concat(), .join() and .splice() help you combine arrays, iterate through them, or update their content. 5. Evaluate & Organize Use .sort(), .reverse(), .every(), .some(), and .reduce() to evaluate, sort, or summarize your array in one line. Learn JavaScript 💫 W3Schools.com JavaScript Mastery freeCodeCamp 👉 Follow me Arun Dubey #Linkedin #LinkedinCommunity #Connections #viral #fyp #w3schools #expressjs #javascript #frontend #backend #developers #css #reactjs #nextjs #roadmap #webdevelopment #mern #mean #angular #nodejs #expressjs #postgresql #sql #guide #useful #notes
To view or add a comment, sign in
-
-
🚀 Mastering JavaScript Array Methods – My Practice Journey 💻✨ ✨Today, I focused on strengthening my understanding of JavaScript Array Methods by solving real-world problems. These built-in methods make code cleaner, faster, and more efficient.✨ Here’s what I explored 👇 🔹 map() – Used to transform data (e.g., adding GST to product prices) 🔹 filter() – Extracted specific data (e.g., getting only active users) 🔹 reduce() – Calculated a single value from an array (e.g., total cart value) 🔹 find() – Found the first matching element (e.g., first expensive product) 🔹 findIndex() – Retrieved index of a specific element 🔹 some() – Checked if any condition is true (e.g., out-of-stock products) 🔹 every() – Verified if all elements satisfy a condition 🔹 includes() – Checked if a value exists in an array 🔹 indexOf() & lastIndexOf() – Used for duplicate handling and comparisons 🔹 sort() – Arranged data (e.g., sorting products by price) 🔹 splice() – Added/removed elements at a specific position 🔹 slice() – Extracted a portion of an array without modifying original 🔹 concat() – Merged arrays 🔹 flat() – Flattened nested arrays into a single array 🔹 fill() – Replaced all elements with a static value 🔹 split() & join() – Converted between strings and arrays 🔹 reverse() – Reversed array elements (used for reversing words) 🔹 Loops & Objects – Used for counting occurrences and handling unique values 💡 Key Takeaways: ✔️ Learned when to use each method ✔️ Improved problem-solving approach ✔️ Understood real-world applications of arrays #JavaScript #WebDevelopment #FrontendDevelopment #CodingPractice #LearningJourney
To view or add a comment, sign in
Explore related topics
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
Currently learning JavaScript and trying to understand how the DOM works. If you have any tips or resources that helped you when starting with JS, feel free to share. I would really appreciate it!