Just published a new blog on Control Flow in JavaScript — titled “𝗗𝗘𝗖𝗜𝗦𝗜𝗢𝗡𝗦.” When I started this JS series, I told myself I’d keep it 𝘀𝗶𝗺𝗽𝗹𝗲 𝗮𝗻𝗱 𝗰𝗹𝗲𝗮𝗿. One concept at a time. So far the series looks like this: 𝟬𝟭 – 𝗝𝗦 𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲𝘀 𝟬𝟮 – 𝗢𝗽𝗲𝗿𝗮𝘁𝗼𝗿𝘀 𝗣𝗿𝗼𝗺𝗶𝘀𝗲𝘀 (𝘄𝗶𝗹𝗱 𝗰𝗮𝗿𝗱) 𝟬𝟯 – 𝗗𝗲𝗰𝗶𝘀𝗶𝗼𝗻𝘀 (𝗖𝗼𝗻𝘁𝗿𝗼𝗹 𝗙𝗹𝗼𝘄) It’s interesting how programming really comes down to this.. 𝘴𝘵𝘰𝘳𝘦 𝘥𝘢𝘵𝘢 → 𝘰𝘱𝘦𝘳𝘢𝘵𝘦 𝘰𝘯 𝘪𝘵 → 𝘥𝘦𝘤𝘪𝘥𝘦 𝘸𝘩𝘢𝘵 𝘩𝘢𝘱𝘱𝘦𝘯𝘴 𝘯𝘦𝘹𝘵. That’s what this post focuses on. Also… yes, I’ve been using scorpions in the thumbnails lately. No deep philosophy behind it. I just like how they look. If you're learning JavaScript or revising fundamentals, you might find it useful. 🔗 https://lnkd.in/gR6HsW5E Feedback is always welcome. #JavaScript #WebDevelopment #LearningInPublic
Control Flow in JavaScript: Decisions and Control Flow
More Relevant Posts
-
If you’re learning JavaScript, these array methods will save you a lot of time. Instead of writing long loops, you can use 𝗯𝘂𝗶𝗹𝘁-𝗶𝗻 𝗺𝗲𝘁𝗵𝗼𝗱𝘀 like: • push() • pop() • shift() • unshift() • map() • filter() • reduce() • forEach() They make your code 𝗰𝗹𝗲𝗮𝗻𝗲𝗿, 𝘀𝗵𝗼𝗿𝘁𝗲𝗿, 𝗮𝗻𝗱 𝗲𝗮𝘀𝗶𝗲𝗿 𝘁𝗼 𝗿𝗲𝗮𝗱. While documenting my learning journey, I wrote a beginner-friendly blog explaining these methods with 𝘀𝗶𝗺𝗽𝗹𝗲 𝗲𝘅𝗮𝗺𝗽𝗹𝗲𝘀 and 𝘃𝗶𝘀𝘂𝗮𝗹 𝗱𝗿𝘆 𝗿𝘂𝗻𝘀. 𝗥𝗲𝗮𝗱 𝗵𝗲𝗿𝗲 👇 https://lnkd.in/gghsxHJX Chai Aur Code ☕ #javascript #webdevelopment #learninpublic
To view or add a comment, sign in
-
-
Building on the basics of JavaScript, I’ve gained a solid understanding of how core components build a functional system. Writing code is the heart of this process, and seeing these concepts integrate is a major highlight of my learning. I have been practicing variable assignments using let, const, and var, while using typeof to identify different data types. I also learnt how to structure Control Flow through if/else statements, switch cases, and comparison operators. By using logical operators—specifically AND (&&) and OR (||)—along with strict equality (===), I can now set multiple rules for my code. I understand how to ensure that if a primary condition isn't met, the "else" logic applies correctly so the program follows a specific path. I also learnt how to use for loops combined with the .length property. This allows the code to automatically track the number of characters or items in a dataset. Instead of hard-coding values, I can now write dynamic code that adjusts to the data it receives. I am still working through the fundamentals, and I am excited to see how everything will work together once the foundation is complete! #JavaScript #WebDevelopment #CodingJourney #SoftwareEngineering #Techcrush #Frontend
To view or add a comment, sign in
-
-
📣 𝗡𝗲𝘅𝘁 𝗕𝗹𝗼𝗴 𝗶𝘀 𝗛𝗲𝗿𝗲! ⤵️ Function Declaration vs Function Expression — What’s the Real Difference? 🧠⚙️ Functions help you stop repeating logic. But JavaScript gives you more than one way to create them. This blog explains the difference between function declarations and function expressions — in a calm, beginner-friendly way. 🔗 𝗥𝗲𝗮𝗱 𝗵𝗲𝗿𝗲: https://lnkd.in/gfrPt9t2 𝗧𝗼𝗽𝗶𝗰𝘀 𝗰𝗼𝘃𝗲𝗿𝗲𝗱 ✍🏻: ⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺⎺ ⇢ Why functions exist (reusability mental model) ⇢ Function declaration syntax and usage ⇢ Function expression and storing functions in variables ⇢ Side-by-side comparison of both styles ⇢ Hoisting explained through simple experiments ⇢ The confusing var behavior trap ⇢ When to prefer declarations vs expressions ⇢ Real practice examples that make the difference click ⇢ Beginner advice to avoid overthinking 💬 If hoisting or function types ever confused you, this article helps you see the practical difference instead of memorizing theory. #ChaiAurCode #JavaScript #Functions #ProgrammingBasics #WebDevelopment #Beginners #LearningInPublic #100DaysOfCoding
To view or add a comment, sign in
-
-
🚀 Practicing Selection Sort in JavaScript Today I spent some time strengthening my understanding of sorting algorithms by implementing Selection Sort on a single array using JavaScript. 🧠 My Approach: 1. Loop through the array 2. Track the index of the smallest element 3. Use an if condition to compare and update the minimum value 4. Swap it with the current position 🖋️ Example : let arr = [23,3,41,12,2,56,15] ; and the result is : [2,3,12,15,23,41,56] 📈 Time Complexity: Best Case : O(n²) Average Case : O(n²) Worst Case : O(n²) 📌 Key Takeaway: Selection Sort is all about selection + swapping. Simple logic, but powerful for building strong foundations. 🔗 Check out my GitHub for the full code. #JavaScript #DSA #CodingPractice #Algorithms #SelectionSort #LearningJourney 😊
To view or add a comment, sign in
-
🔥 Understanding What Really Happens Behind JavaScript on Server! Continuing my Node.js journey, Episodes 2 & 3 gave me some serious clarity about how things actually work under the hood 🤯 📺 Episode 2 – JavaScript on Server This episode completely changed how I look at servers 👇 🖥️ A server is nothing fancy… just a remote computer (CPU) running somewhere else 💡 Node.js is not magic — it’s actually a C++ application And the famous V8 engine? 👉 Also written in C++ ⚙️ The coolest part: V8 can be embedded into any C++ program → that’s how Node.js runs JavaScript outside the browser 🔄 Execution pipeline looks like this: 👉 JavaScript → V8 Engine → Machine Code → Binary 📜 And behind all this, we have ECMAScript — the rulebook that defines how JavaScript should behave 🧠 Going from high-level code to machine-level execution = total brain explosion moment 💥 📺 Episode 3 – Global Object This episode cleared a very important concept about environments 🌍 🧠 Global Object = the top-level object that gives access to global variables and functions 🔹 In the browser, we use: 👉 window, this, self 🔹 In Node.js, we use: 👉 global 💡 But to solve this confusion, a universal solution was introduced: 👉 globalThis ✅ Now the same code can run in both browser & Node.js without worrying about environment differences Big thanks to Akshay Saini 🚀 for breaking down these concepts in such a simple and relatable way! #NamasteNodeJS #NodeJS #JavaScript #AkshaySaini #JSonServer
To view or add a comment, sign in
-
-
Reposting this because it perfectly captures the love–hate relationship we all have with JavaScript 😄 Programming really does teach you logic… But JavaScript? It teaches you patience. You think you understand everything — Then: "11" + 1 → "111" "11" - 1 → 10 And suddenly you’re reviewing your life choices 😂 Jokes aside, this highlights something important: • Type coercion matters • Understanding data types matters • Small assumptions create big bugs In my experience, most tricky bugs aren’t “complex architecture problems” — they’re small misunderstandings of how the language behaves. As developers, we don’t just write code. We learn how machines interpret our instructions. And sometimes… how they interpret them differently than we expected 😅 Despite all the chaos, JavaScript remains one of the most powerful and versatile languages in the world — from browsers to full-stack systems. Love it or hate it… you can’t ignore it. #JavaScript #WebDevelopment #CodingLife #100DaysOfCode #Developers #ProgrammingHumor
To view or add a comment, sign in
-
-
just published my blog. 📝 Understanding Variables and Data Types in JavaScript when I started JS I thought variables were the easy part. then I met var. and let. and const. then type coercion showed up and I had questions. so I did what made sense wrote it all down in a way that actually makes sense for beginners. if you're just starting out with JavaScript or confused about the basics, this one's for you. 🙌 🔗 link in the first comment 👇 grateful to Hitesh Choudhary Piyush Garg Akash Kadlag Jay Kadlag Chai Code for pushing us beyond just writing code.
To view or add a comment, sign in
-
-
Most people think they understand JavaScript classes. They don’t. Because JavaScript doesn’t even have real classes. What it actually has is prototypes — and classes are just syntactic sugar on top of them. Today in my T9 class, this completely changed how I look at JS: → Prototype-based inheritance (the actual mechanism) → Traditional vs Modern prototype handling → Constructor Functions (how things worked before classes) Then we moved to what most people are comfortable with: → Classes in JavaScript → constructor, extends, super, static → The 4 pillars of OOP: Encapsulation Inheritance Polymorphism Abstraction But here’s the uncomfortable truth: If you don’t understand prototypes, you don’t actually understand inheritance in JavaScript. You’re just memorizing syntax. That’s why debugging feels random. That’s why “this” behaves weird. That’s why things break in unexpected ways. Now it makes sense. Still early in the journey — but this was one of those “everything clicks” moments. Do you think JS should have stayed purely prototype-based, or are classes a good abstraction? #JavaScript #OOPS #WebDevelopment #LearningInPublic Thankyou Chai Aur Code Suraj Kumar Jha Sir Hitesh Choudhary Sir Piyush Garg Sir
To view or add a comment, sign in
-
-
🧠 Something interesting I learned while building my own JavaScript utility library. While structuring the project, I noticed a common pattern used in many real libraries. Inside each folder we often create an index.ts file. This file works like a central export file that collects exports from all the sub-files in that folder. Example: export * from "./chunk" export * from "./unique" export * from "./flatten" Instead of importing from deep paths like this: import { chunk } from "./array/chunk" we can simply do: import { chunk } from "./array" This pattern is often called a barrel export and is widely used in real-world libraries to keep APIs clean and organized. I discovered this while building my own small utility library and found it really interesting. Curious to know — Do you prefer using barrel exports (index.ts) in your projects? #javascript #typescript #webdevelopment #nodejs #softwareengineering #coding #devcommunity #programming #frontenddevelopment #backenddevelopment
To view or add a comment, sign in
-
-
🚀 Arrays are NOT real arrays in JavaScript. That was one of the most interesting things I learned today while studying Arrays in JavaScript. At first, arrays seem simple — just a collection of elements. But under the hood, JavaScript arrays are actually objects with special behavior, not fixed-size contiguous memory structures like in languages such as C++. What I learned about Arrays: • Arrays in JavaScript are mutable • They can store multiple data types • They are dynamic in size Key operations I practiced: • Adding/removing elements → push(), pop(), shift(), unshift() • Looping → classic for loop and modern iteration methods • Searching → indexOf(), lastIndexOf(), includes() • Manipulation → slice(), splice() • Conversion → join() (array → string) • Spread operator → modern and powerful way to copy/merge arrays One important insight: The sort() method can behave unexpectedly with numbers because it sorts values as strings by default. Example: [10, 2, 5].sort() // Output -> [10, 2, 5] To sort numbers correctly, we need a comparison function. To summarize everything, I created a detailed carousel Notes (Notes given by Rohit Negi). Course Instructor: Rohit Negi | Youtube Channel: Coder Army #JavaScript #WebDevelopment #LearningJourney #BuildInPublic #FrontendDevelopment #Fullstackdevelopment #Coding
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