💡 Understanding Object Methods in JavaScript Working with objects is fundamental in JS. Here's a quick overview of some powerful methods: Object.keys(obj) → Returns all keys of the object. Object.values(obj) → Returns all values of the object. Object.entries(obj) → Returns key-value pairs as arrays. obj.hasOwnProperty("property") → Checks if the object has a specific property. Object.assign({}, obj, { newProperty: "newValue" }) → Creates a new object by merging existing ones. 👉 View the full example on GitHub: https://lnkd.in/dDN-vDkD #JavaScript #FullStack #100xDevs #WebDevelopment #Coding #JSConcepts #LearnJavaScript
Mastering Object Methods in JavaScript with Examples
More Relevant Posts
-
🧠 JavaScript Concepts I Explored Today Today was a solid learning session — I spent time understanding how functions actually shape the logic in JavaScript. Here’s what I went through 👇 Functions and how they make code reusable First-class and higher-order functions (functions inside functions 🔁) Closures — the part where JS “remembers” variables even after execution IIFE — functions that run instantly (good for isolated scopes) Arrays — map, filter, reduce, forEach Objects — destructuring, looping, optional chaining These concepts connected so many dots for me. The more I write JavaScript, the more I realize how expressive it can be when you actually understand the “why” behind the syntax. #JavaScript #CodingJourney #WebDevelopment #Frontend #MERNStack
To view or add a comment, sign in
-
Today I explored some of the most powerful array methods in JavaScript — map(), filter(), and reduce() ✨ These functions make working with data so much easier and cleaner. 🔹 map() — transforms each element in an array. 🔹 filter() — filters elements based on a condition. 🔹 reduce() — reduces the array to a single value (like sum, average, etc.). While practicing, I understood how combining them can make code much shorter and more readable. Feeling more confident in writing cleaner JavaScript code now! 💻💡 #JavaScript #WebDevelopment #LearningJourney #Coding #FrontendDevelopment #JSMap #Filter #Reduce #Developer
To view or add a comment, sign in
-
🚀 Starting My JavaScript Revision Journey! Body: Yesterday, I went back to the basics of JavaScript to strengthen my foundation. Here’s what I revised: 🟡 Variables — var, let, and const and when to use them 🟡 Scope — Global variables (accessible everywhere) — Local variables (accessible within a function/block) 🟡 Data Types — Primitive: string, number, boolean, null, undefined, symbol, bigint — Non-Primitive: objects, arrays, functions It’s amazing how revisiting fundamentals clears a lot of confusion! What JavaScript concept took you time to understand when starting out? #JavaScript #BackendDevelopment #LearningJourney #Coding
To view or add a comment, sign in
-
Day 5 of #30DaysOfJavaScript: Creating My Own Filter Function from Scratch! 🎯 Today, I tackled a great exercise that challenged me to build a custom filter function without using JavaScript’s built-in .filter() method. This involved iterating over an array and using a callback function to decide which elements to keep based on truthy values. Here’s a peek at the solution I wrote: Key takeaways from this challenge: Deepened my understanding of higher-order functions and callback usage. Learned how to evaluate truthy and false values in JavaScript more effectively. Gained appreciation for the power and convenience of built-in array methods by implementing one manually. This hands-on approach is helping me grasp fundamental JavaScript concepts in detail while preparing for real-world coding challenges. Excited to keep growing and solving more problems along the way! Let’s connect and share knowledge. #JavaScript #CodingChallenge #WebDevelopment #LeetCode #ArrayMethods #LearningByBuilding #DeveloperJourney
To view or add a comment, sign in
-
-
❓ Are “undefined” and “not defined” the same in JavaScript? Not really. In JavaScript, every declared variable automatically gets the placeholder undefined during the memory allocation phase — meaning the variable exists, but no value has been assigned yet. However, if you try to access a variable that was never declared, JavaScript throws not defined. ➡️ Undefined = declared but not assigned ➡️ Not Defined = not declared at all JavaScript is also a loosely typed language, so variables can change types freely. 💡 Pro tip: Never manually assign undefined. Let JavaScript handle that. #JavaScript #WebDevelopment #Programming #Frontend #LearningJS
To view or add a comment, sign in
-
🚀 Day 11 of My 30 Days of JavaScript Journey ✅ Challenge: Memoize (LeetCode #2623) The task was to create a memoize(fn) function that caches results so that repeated calls with the same inputs return instantly from cache — without re-executing the original function. This helps improve performance when dealing with expensive computations like fibonacci or factorial, and even simple operations like sum when called repeatedly. 💻 Language Used: JavaScript ❓ Problem Link: https://lnkd.in/gnHmbPih 💡 Solution: https://lnkd.in/gGJZjYY9 🧠 Concept Highlighted: Memoization is a powerful optimization technique that uses caching to avoid repeating calculations. It strengthens understanding of closures, function arguments handling, and performance-oriented JavaScript. #JavaScript #LeetCode #30DaysOfCode #CodingChallenge #WebDevelopment #FrontendDevelopment #Memoization #PerformanceOptimization #LearningEveryday #ProblemSolving
To view or add a comment, sign in
-
🚀 Today I started learning about the ‘this’ keyword in JavaScript! Understanding this is one of the most powerful (and tricky) parts of JS — it changes based on where and how it’s used. Here’s what I explored 👇 💡 Global scope – how this points to the window object 💡 Inside functions – how context changes 💡 In object methods – how this refers to the calling object 💡 Event handlers – how this refers to the DOM element 💡 Call, Apply, and Bind – how to manually control this Every example helped me understand JS execution context more deeply. Excited to keep diving into closures, prototypes, and advanced JS concepts next! ⚡ #JavaScript #WebDevelopment #LearningJourney #Coding
To view or add a comment, sign in
-
-
🚀 JavaScript Practice: Prime Numbers from 1 to 100 Here's a simple yet classic logic-building problem — finding all prime numbers between 1 and 100 using JavaScript. Key learnings from this program: ✅ Nested loops usage ✅ Logical thinking with condition checks ✅ Introduction to algorithmic problem-solving 💡 Tech Used: JavaScript 👨💻 Concept: Prime Number Detection #JavaScript #Coding #100DaysOfCode #SoftwareEngineer #LearningInPublic #LogicBuilding #FrontendDevelopment
To view or add a comment, sign in
-
-
How JS Converts [] + {} to [object Object] —🤯 JavaScript can be weirdly magical sometimes. Ever tried this in your console? 👇 [] + {} // Output: "[object Object]" At first glance, it looks confusing — why does an empty array and an empty object become a string? Let’s decode the magic 🪄 1️⃣ + Operator in JS The + operator doesn’t just add numbers — it can also concatenate strings. 2️⃣ Type Conversion Happens! [] (empty array) → when converted to string becomes "" (empty string). {} (empty object) → when converted to string becomes "[object Object]". 3️⃣ Final Expression So JS actually does: "" + "[object Object]" → "[object Object]" ✅ Bonus twist: Try reversing it: {} + [] Now it gives 0 because {} is treated as an empty block,not an object. 🤯 JavaScript — where logic meets magic ✨ 🔹 Follow Prashansa Sinha for more fun JS mysteries and simple explanations 👩💻 #JavaScript #WebDevelopment #Coding #Frontend #JS #LearnToCode #Programming #TechCommunity #Developers #CodeNewbie #WebDev
To view or add a comment, sign in
-
🚀 Day 80 of #100DaysOfCode Today I learned about object literals in JavaScript. Object literals are a simple way to store data as key-value pairs inside curly braces. This makes it easy to organize related information and lets you access values using property names. Object literals are great for creating flexible and readable code. #JavaScript #ObjectLiterals #Learning #100DaysOfCode
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