💡 JavaScript Challenge: Check if Two Words Are Anagrams Here’s a simple yet powerful JavaScript solution to check if two strings are anagrams of each other 💻 🔍 What’s an Anagram? An anagram is a word formed by rearranging the letters of another — for example: 👉 listen → silent ✅ 👉 hello → world ❌ 🧠 Logic Behind the Code: Compare lengths of both strings. Count occurrences of each character in the first string. Decrease the count for each character in the second string. If all counts match, they’re anagrams! #JavaScript #CodingChallenge #100DaysOfCode #WebDevelopment #ProblemSolving
JavaScript Challenge: Check if Two Strings Are Anagrams
More Relevant Posts
-
typeof null" JavaScript ka 30 saal purana bug! 😱 #frontenddeveloper #jsinterview JavaScript trick time! 🚀 Do you know why typeof null returns 'object' instead of 'null'? 🤯 Watch this short to understand one of the oldest bugs in JavaScript — still present today! #JavaScript #WebDevelopment #TheDeveloperSchool #JSInterview #CodingShorts #FrontendDeveloper
To view or add a comment, sign in
-
Lately, I’ve been revisiting some core JavaScript concepts, and today I stumbled upon something I hadn’t really paid attention to before — Symbols. They’re not something you see in everyday code, but I found them really interesting. A Symbol is a unique and immutable value that can be used as a key in objects. What I like about Symbols is that each one is completely unique, even if it has the same description: Symbol("id") === Symbol("id"); // false They can be super useful when you need unique property keys in an object — especially to avoid accidental overwriting. Even if I might not use them often, I enjoy discovering these little parts of JavaScript that make the language more powerful than it first seems. #JavaScript #WebDevelopment #LearningEveryDay
To view or add a comment, sign in
-
-
𝗘𝘃𝗲𝗿 𝗵𝗮𝗱 𝘆𝗼𝘂𝗿 𝗰𝗼𝗱𝗲 𝗮𝗰𝘁 𝘀𝘁𝗿𝗮𝗻𝗴𝗲 𝗮𝗻𝗱 𝘆𝗼𝘂 𝗰𝗼𝘂𝗹𝗱𝗻’𝘁 𝘁𝗲𝗹𝗹 𝘄𝗵𝘆? 😅 It happens a lot in JavaScript, especially when working with something called 𝗍𝗋𝗎𝗍𝗁𝗒 𝖺𝗇𝖽 𝖿𝖺𝗅𝗌𝗒 𝗏𝖺𝗅𝗎𝖾𝗌. In simple terms, JavaScript treats some things as true and others as false even if they don’t literally say “true” or “false.” I made a short snippet to show what I mean 👇 ✅ Lesson: Always check what’s really true or false before assuming. You can test it in the console using 𝗕𝗼𝗼𝗹𝗲𝗮𝗻(𝘃𝗮𝗹𝘂𝗲) to see if something is true or false. It’s a small thing but it can save hours of debugging. 👉 Learning by solving. 💻 #KabikaLearnsJS #JavaScript #WebDevelopment #CodingJourney #FrontendDevelopment
To view or add a comment, sign in
-
-
JavaScript for 15 Days – Day 5: Functions Today, You will learn about Functions, one of the most important concepts in JavaScript. A function is basically a reusable block of code that performs a specific task. It helps you write cleaner, more organized, and less repetitive code. Example: function greet(name) { return `Hello, ${name}!`; } console.log(greet("Moussa")); // Hello, Moussa! Why functions matter: - They make your code reusable and modular. - They improve readability. - They help you manage logic step by step. JavaScript also supports arrow functions and function expressions, which you’ll explore in slides! #JavaScript #FrontendDevelopment #CodingJourney #LearnToCode #WebDevelopment #15DaysJS #DevPerDay
To view or add a comment, sign in
-
Did you know this about JavaScript? In JavaScript: [ ] == ![ ] is true. Wait, what? Here’s why: ![ ] becomes false because an empty array is truthy. So the expression becomes [ ] == false. JavaScript tries to convert both sides to the same type. Number([ ]) is 0, and Number(false) is also 0. Therefore, 0 == 0 → true. This is one of the reasons developers say: "JavaScript is simple… until it isn’t." I’m currently learning JavaScript and finding these little quirks really fascinating. If you’re also learning, what’s the weirdest or most surprising thing you’ve discovered so far? #JavaScript #WebDevelopment #CodingJourney #100DaysOfCode #DidYouKnow #LearnInPublic #FrontendDevelopment
To view or add a comment, sign in
-
-
🚀 Day 9 of My 30 Days of JavaScript Journey ✅ Challenge: Arguments Length (LeetCode #2703) Write a function argumentsLength that returns the total number of arguments passed to it — no matter how many or what type! This challenge is a simple yet powerful way to understand rest parameters in JavaScript. 💻 Language Used: JavaScript ❓ Problem Link: https://lnkd.in/g8gK65Cp 💡 Solution: https://lnkd.in/gJQyNBaq 🧠 Concept Highlighted: This problem emphasizes the use of rest parameters (...args) to handle variable-length arguments, a handy feature for building flexible and reusable functions in JavaScript. #Day9 #JavaScript #LeetCode #30DaysOfCode #CodingChallenge #WebDevelopment #FrontendDevelopment #LearningEveryday #ProblemSolving #ES6
To view or add a comment, sign in
-
JavaScript Unique Magic: Hoisting Definition: Hoisting in JavaScript means moving all variable and function declarations to the top of their scope before the code runs. This allows you to use a function or variable even before it is written in the code. Why It Happens: JavaScript interpreter reads the entire code first and sets up memory for all variables and functions. That why you can access them before their actual line of code appears. Uses: 1) Helps in calling functions before they are defined. 2) Makes code organization flexible. Problems: 1) Can cause confusion for beginners. 2) Variables declared with var become undefined if used before declaration. 3) let and const declarations cause an error if used too early #JavaScriptMagic #CodingTips #LearnJS #FrontendFun #ProgrammingLife #JSBeginners #WebDev #TypeScript #CodeSmart #DeveloperCommunity
To view or add a comment, sign in
-
Hoisting is JavaScript’s way of moving declarations (not initializations) to the top of their scope before execution. 🧩💡 Tip: Always declare before use — hoisting can surprise you! #JavaScript #WebDev #FrontendTips #StructuredClone #JSDeepCopy #CodingTips #WebDevelopment Examples:
To view or add a comment, sign in
-
-
JavaScript for 15 Days – Day 4: Why We Still Use ; One of the smallest symbols in JavaScript — the semicolon ( ; ) — often causes big debates. Do we still need it? Technically, JavaScript can insert semicolons automatically (ASI), but it doesn’t always get it right. Example: return "Hello"; // ❌ returns undefined Using ; makes your code more explicit, safe, and consistent — especially in larger projects or when your code is minified. Lesson learned: Semicolons might be optional, but clean and predictable code is not . #JavaScript #FrontendDevelopment #LearnToCode #CodingJourney #WebDevelopment #15DaysJS #DevPerDay
To view or add a comment, sign in
-
Today I Learned: JavaScript Functions in Depth Functions are the backbone of JavaScript they make our code reusable, organized, and powerful. Here’s what I learned today 👇 ✅ What functions are and why we use them ✅ Parameters & arguments ✅ Default and rest parameters ✅ Destructured parameters ✅ Nested functions & scope chain ✅ Arrow functions ✅ IIFE (Immediately Invoked Function Expressions) Every concept makes me realize how flexible and deep JavaScript really is. #JavaScript #WebDevelopment #100DaysOfCode #FrontendDevelopment #LearningInPublic
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