💡 Same function name. Same call. Different languages… different outcomes. Here’s a simple comparison 👇 🔹 JavaScript ```javascript function add(a, b) { return a + b; } function add(a, b, c) { return a + b + c; } console.log(add(1, 2, 3, 4)); ``` 👉 Output: 6 (extra argument is ignored, last function overrides previous) 🔹 C# ```csharp void Add(int a, int b) { } void Add(int a, int b, int c) { } Add(1, 2, 3, 4); ``` 👉 Output: Compile-time error ❌ (No method matches 4 parameters) ⚖️ Key Comparison: ✔ JavaScript • Flexible with arguments • Ignores extra values • Function overriding (last one wins) • Can silently introduce bugs ✔ C# • Strong method overloading • Strict parameter matching • No extra arguments allowed • Errors caught early 🎯 Takeaway: What works in one language may fail in another. #JavaScript #CSharp #Programming #Developers #CodingTips #Tech
JavaScript vs C# Method Overloading: Key Differences
More Relevant Posts
-
JavaScript: Logical Operators 🧠 Want to make smart decisions in JavaScript code? Learn Logical Operators. Logical operators help your program decide what should happen next. They are used in conditions, validations, and real-world logic. Here are the 3 main ones 👇 • AND (&&) Both conditions must be true age > 18 && hasLicense • OR (||) At least one condition must be true isAdmin || isEditor • NOT (!) Reverses the result !isLoggedIn These operators are used in if statements, authentication checks, form validation, and many real projects. Small concept. Very powerful in coding. #JavaScript #WebDevelopment #FrontendDevelopment #ProgrammingBasics #LearnJavaScript #CodingForBeginners #SoftwareEngineering #DeveloperTips #TechLearning #CodeNewbie
To view or add a comment, sign in
-
-
HTML Script Loading Scenario A developer writes: <script src="app.js"></script> Where should this script be placed for better page load performance? A. Inside <head> without attributes B. At the end of <body> C. Anywhere, no difference D. Inside <title> 💬 What’s your answer? #BuildSmart #SoftwareEngineers #itskill #programmer #codinglife #javascript
To view or add a comment, sign in
-
-
🚨 7 JavaScript Facts That Will Blow Your Mind 🤯 Think you know JavaScript? Wait till you see these 👇 1️⃣ NaN !== NaN 👉 Not even equal to itself 2️⃣ [] + [] = "" 👉 Empty arrays become an empty string 3️⃣ null + 1 = 1 👉 null is converted to 0 4️⃣ typeof null === "object" 👉 This is a bug in JavaScript 5️⃣ 0.1 + 0.2 !== 0.3 👉 Floating point precision issue 6️⃣ == vs === 👉 Always prefer === (strict equality) 7️⃣ JavaScript is single-threaded 👉 Handles async using the event loop 💡 One line to remember: 👉 “JavaScript is simple… until it’s not 😏” 💬 Which fact surprised you the most? 📌 Save this for interviews & quick revision #javascript #webdevelopment #frontend #coding #programming #javascriptdeveloper #learncoding #developers #100DaysOfCode
To view or add a comment, sign in
-
-
Day 10 / 30 - Javascript Coding Challenge Problem: Given an array of functions [f1, f2, f3, ..., fn], return a new function fn that is the function composition of the array of functions. The function composition of [f(x), g(x), h(x)] is fn(x) = f(g(h(x))). The function composition of an empty list of functions is the identity function f(x) = x. You may assume each function in the array accepts one integer as input and returns one integer as output. Solution: var compose = function (functions) { return function (x) { let sum = x; for (let k = functions.length - 1; k >= 0; k--) { sum = functions[k](sum) } return sum } }; #JavaScript #FunctionalProgramming #DSA #CodingPractice #100DaysOfCode #FrontendDevelopment
To view or add a comment, sign in
-
-
📚 JavaScript: Array vs Object 💡 Many beginners get confused between Array and Object in JavaScript. But the difference is actually very simple 👇 ✅ Array • Used to store a list of items • Values are ordered • Access items by index like 0, 1, 2 Example: ["Apple", "Mango", "Banana"] ✅ Object • Used to store key-value pairs • Best for structured data • Access values by key Example: { name: "John", age: 25 } 👉 Use Array when you need a list. 👉 Use Object when you need data with labels. Understanding this basic concept makes JavaScript much easier to learn 🚀 #JavaScript #WebDevelopment #Programming #FrontendDevelopment #Coding #ReactJS #LearnJavaScript #Developer #TechCommunity #100DaysOfCode
To view or add a comment, sign in
-
-
Just published a blog on JavaScript Modules (import & export). No more messy files. No more random functions everywhere. Everything becomes more organized and scalable. In this blog, I covered: • Why modules are actually needed • How exporting and importing works • Default vs named exports (the confusing part) • How modules improve maintainability • Simple mental models + diagrams https://lnkd.in/gPSpcDid #javascript #webdevelopment #frontend #coding #learninpublic #100daysofcode #developerjourney #programming #softwaredevelopment #beginners #tech
To view or add a comment, sign in
-
🚀 Mastering JavaScript Arrays now! 🚀 Arrays are a fundamental data structure in JavaScript, allowing you to store multiple values in a single variable. They are versatile and can hold different types of data, making them essential for developers to manage and manipulate data efficiently in their applications. To create an array in JavaScript, start by declaring a variable and assigning it to square brackets containing your values. Access elements using their index, starting from 0. Remember to use built-in array methods like push() and pop() to add or remove elements easily. ```javascript let fruits = ['apple', 'banana', 'orange']; console.log(fruits[0]); // Output: apple fruits.push('grape'); // Add 'grape' to the end fruits.pop(); // Remove the last element ``` Pro tip: Use array destructuring to unpack values from arrays into distinct variables, enabling cleaner and more concise code. Common mistake: Forgetting that array indices start at 0 can lead to errors in accessing elements, so always count from 0 when working with arrays. 🤔 What's your favorite method to manipulate arrays? Share your tips! 🤓 🌐 View my full portfolio and more dev resources at tharindunipun.lk #JavaScript #Programming #WebDevelopment #CodingTips #ArrayManipulation #DeveloperCommunity #CodeNewbie #TechTalk
To view or add a comment, sign in
-
-
"Closures in JavaScript" sounds complicated… but it’s actually very powerful 🔥 Let’s simplify it 👇 🔹 What is a Closure? A closure is when a function remembers variables from its outer scope even after the outer function has finished execution. 🔹 Why does it matter? Because it allows: - Data hiding 🔐 - State management 📦 - Cleaner and modular code 💻 Example: function outer() { let count = 0; return function inner() { count++; console.log(count); } } const counter = outer(); counter(); // 1 counter(); // 2 👉 Even after "outer()" is executed, "inner()" still remembers the "count" variable. That’s the power of closures 💡 🚀 Real-world use cases: - React hooks - Event handlers - Callbacks 💬 Have you used closures in your projects yet? #javascript #webdevelopment #mern #coding #developers
To view or add a comment, sign in
-
💥 JavaScript: Where Logic Goes to Die 🤯 Think you understand JavaScript? These mind-bending quirks might change your mind… ⚡ Ever wondered: 👉 Why 9999999999999999 becomes 10000000000000000? 👉 Why 1 < 2 < 3 is true, but 3 > 2 > 1 is false? 👉 Why [] == false is true but [] === false is false? 🧠 Welcome to the world of: ✔️ Type Coercion ✔️ Floating Point Precision ✔️ Weird Comparisons ✔️ Truthy vs Falsy Values 💡 For example (from page 9): 0.1 + 0.2 === 0.3 → ❌ false Because JavaScript uses floating-point math, resulting in 0.30000000000000004 😂 And the classic: 'b' + 'a' + + 'a' + 'a' → “banana” (sort of 😅) 🚀 These aren’t bugs — they’re how JavaScript actually works! 📌 If you're a developer, mastering these quirks will save you from real-world bugs. 💬 Which one shocked you the most? #JavaScript #WebDevelopment #Coding #JS #Frontend #Programming #Developers #CodingLife
To view or add a comment, sign in
-
💀 JavaScript: Where Logic Goes to Die 🤯 If you think JS is simple… Try explaining these 👇 . ⚡ 9999999999999999 → becomes 10000000000000000 Because numbers lose precision beyond limits (page 2) . ⚡ 1 < 2 < 3 → true But 3 > 2 > 1 → false Because comparisons run left to right 😵 (page 3) . ⚡ [] == false → true But [] === false → false Welcome to type coercion madness (page 4) . ⚡ '5' - 3 → 2 But '5' + 3 → "53" JS decides when to convert types 😅 (page 5) . ⚡ 0.1 + 0.2 === 0.3 → false Floating-point precision strikes again 💥 (page 8) . ⚡ typeof NaN → "number" Yes… seriously 😐 (page 10) . ⚡ 'b' + 'a' + + 'a' + 'a' → "banana" 🍌 Don’t ask… just accept it 😂 (page 11) . ❌ JavaScript is not broken ✅ You just don’t know its rules yet . 💬 Master JS → Master debugging . 📌 Save this before your next interview . Visit: https://lnkd.in/gf23u2Rh Call: 9985396677 | info@ashokit.in Follow @ashokitschool for more updates . #JavaScript #Coding #WebDevelopment #Programming #Developers #JS #Frontend #CodingLife
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