Consistency > excuses. That’s today’s win. Day 10 | JavaScript – Objects Yesterday I missed posting. Today, I didn’t repeat that mistake. After getting comfortable with functions, I moved into objects — a cleaner and more powerful way to store related data. What I learned today: 1. Creating objects using { } 2. Storing data as key–value pairs 3. Accessing: -the whole object -individual properties using dot (.) notation 4. Updating values by reassigning properties 5. Removing properties completely using the delete keyword Objects made it clear how JavaScript organizes real-world data — not just values, but structure. Learning. Day 10 done. #JavaScript #Objects #LearningInPublic #WebDevelopment #DeveloperJourney
Mastering JavaScript Objects for Efficient Data Storage
More Relevant Posts
-
Data Structures & String Magic Today was all about how we store and manipulate data in JavaScript. I moved beyond simple variables and explored the power of Strings and Objects. It’s fascinating to see how similar Strings and Arrays can be, yet how unique they are in their behavior! My Learning Milestones Today: String Mastery: Explored slice, join, concat, and the importance of case normalization (toLowerCase/toUpperCase) for comparisons. The "Reverse" Challenge: Learned three different ways to reverse a string—a classic interview favorite! Object Essentials: Introduction to Properties and Values. I practiced multiple ways to "get" and "set" data using dot notation and bracket notation. Advanced Object Ops: Working with nested objects, using Object.keys() and Object.values(), and learning how to safely delete properties. Iteration: Mastering how to loop through objects to pull out the data I need. Objects are truly the backbone of JavaScript, and I'm feeling much more confident in how to structure my code. 🚀 #JavaScript #WebDevelopment #CodingJourney #StringsAndObjects #FrontendDev #TechGrowth
To view or add a comment, sign in
-
-
Why did Brenden Eich chosed prototype inheritance instead of class based for JavaScript? Key characteristics of JavaScript are simplicity, flexibility, and dynamic. In class-based inheritance, once an object is created, data and method cannot be added or removed but this is possible in prototype inheritance. Ex :- Adding data const person = { name: "Sohail" }; person.age = 22; Adding method function Animal() {} Animal.prototype.eat = function() {}; const dog = new Animal(); Animal.prototype.sleep = function() {}; dog.sleep(); In prototype, we can add data and methods even after creating object. This makes is flexible and dynamic.
To view or add a comment, sign in
-
✨ 𝗗𝗮𝘆 𝟭𝟮 𝗼𝗳 𝗠𝘆 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗝𝗼𝘂𝗿𝗻𝗲𝘆 🚀 Today I explored powerful 𝗔𝗿𝗿𝗮𝘆 𝗠𝗲𝘁𝗵𝗼𝗱𝘀 𝗮𝗻𝗱 𝘁𝗵𝗲 𝗱𝗮𝘁𝗮 𝘀𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲𝘀 𝗦𝗲𝘁 & 𝗠𝗮𝗽. 🔹 Practiced array methods like 𝗺𝗮𝗽(), 𝗳𝗶𝗹𝘁𝗲𝗿(), 𝗿𝗲𝗱𝘂𝗰𝗲(), 𝗳𝗼𝗿𝗘𝗮𝗰𝗵() — making data transformation cleaner and more functional. 🔹 Learned how 𝗦𝗲𝘁 stores unique values. 🔹 Understood how 𝗠𝗮𝗽 stores key-value pairs with better flexibility than plain objects. It’s amazing how these built-in structures make handling data more efficient and readable. Step by step, strengthening my JavaScript fundamentals 💪 #JavaScript #100DaysOfCode #WebDevelopment #LearningJourney #FrontendDevelopment #DataStructures
To view or add a comment, sign in
-
-
𝗧𝗵𝗲 𝗕𝗮𝘀𝗶𝗰𝘀 𝗼𝗳 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁: 𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲𝘀 𝗮𝗻𝗱 𝗗𝗮𝘁𝗮 𝗧𝘆𝗽𝗲𝘀 If you're starting with JavaScript, you'll encounter variables and data types. They are the foundation of programming, from storing a user's name to handling complex application state. Here's what you need to know: - What variables are - How var, let, and const work - JavaScript primitive data types - How JavaScript stores and copies values Variables are like labeled boxes. You put specific items inside them. Understanding how to use these boxes is the first step to becoming a master architect of the web. In programming, variables are containers used for storing data values. You give a name to a piece of information so you can refer to it, move it around, or change it later in your code. let userName = "Subhrangsu" let age =
To view or add a comment, sign in
-
cohort 2.0 JavaScript an array is more than just a list of values. Itss a way to organize information,process data and solve problems efficiently. ex : - let task = ["javascript", "practice coding"]; Add data → push() Remove data → pop() Transform data → map() Filter data → filter() these simple tools allow developers to manipulate data in powerful ways the more i learn code, the more i realize that mastering basic concepts like arrays makes complex problems much easier to solve #JavaScript #CodingJourney #WebDevelopment #learnToCode #CareerGrowth
To view or add a comment, sign in
-
Manually reducing the array in JavaScript challenge. Here is the solution can beat up to 82.5 % on leetcode and others. /** * @param {number[]} nums * @param {Function} fn * @param {number} init * @return {number} */ var reduce = function(nums, fn, init) { // Start the accumulator with the provided initial value let accumulator = init; // Iterate over each element in the array for (let i = 0; i < nums.length; i++) { const currentValue = nums[i]; const currentIndex = i; const sourceArray = nums; // Call the callback function and update the accumulator // The callback receives the accumulator and current value (and optionally index and the full array) accumulator = fn(accumulator, currentValue, currentIndex, sourceArray); } // Return the final accumulated value return accumulator; }; Test case: nums = [1,2,3,4] fn = function sum(accum, curr) { return accum + curr; } init = 0 Output = 10 Please share your thoughts over this.
To view or add a comment, sign in
-
🛑 "Using Nested For-Loop" JavaScript has evolved significantly, but many of us still rely on outdated nested loops, a major bottleneck for performance optimization. If your code looks like the left side of this image, it’s time for an upgrade. Check out this quick breakdown of why nested loops are inefficient and how modern alternatives can revolutionize your data processing: 🔹 The "Don't": Standard nested loops create high overhead and are difficult for the browser to optimize and slow in querying database. They lead to slow code execution. 🔹 The "Do": Modern, clean alternatives like .forEach(), .map(), .filter(), and .reduce(). These methods are not only more readable but also leverage modern engine optimizations for massive speed boosts. Don't let legacy coding habits hold your application back. Embrace the efficiency of modern JavaScript. #JavaScript #CodingBestPractices #SoftwareEngineering
To view or add a comment, sign in
-
-
Day 21: The Final Logic – Closures & The Magic of Property Access 🔒✨ Today marks the grand finale of the JavaScript deep-dive. We didn't just look at the code; we looked at the Memory and the Engine logic that governs how variables live and die. 🧠 The "Crack-It Kit" Checklist: Day 21 📑 🔹 The "Stack Overflow" Trap: Understanding why a setter that calls itself triggers a recursion loop, and the "Underscore Logic" (_variable) used to fix it. 🛡️ 🔹 Getters & Setters: Moving beyond simple data storage to "Smart Properties." Whether using Class syntax or Object.defineProperty, it's about intercepting and validating every piece of data. ⚙️ 🔹 The .length Mystery: Breaking down how arr.length actually works. It’s not just a counter—it’s an exotic property managed by the engine with a setter that can physically truncate memory. 🧪 🔹 Lexical Scoping: Mastering the "Hierarchy of Access." Understanding that where you write your code determines what your functions can see. 🏛️ 🔹 Closures (The Memory Lock): The ultimate interview topic. Learning how JS "locks" parent variables in memory to keep them alive for inner functions, even after the parent has finished executing. 🔒 The JavaScript foundation is now 100% complete. From the TCP 3-way handshake to the internal mechanics of Closures, the logic is locked in. 🏗️ #JavaScript #WebDevelopment #CrackItKit #Closures #WebEngineering #CodingJourney #SoftwareArchitecture #TechInterviews #MERNStack #WanderlustProject
To view or add a comment, sign in
-
-
How API Fetch Works in JavaScript Today I explored fetching data from APIs in JavaScript. Here’s the core idea: const response = await fetch('https://lnkd.in/gtuyqVPs'); const data = await response.json(); console.log(data); Key takeaways: fetch() → request data from an API async/await → makes async code readable response.json() → converts data to usable objects Fun tip: I even visualized this in a colorful notebook-style page with doodles, icons, and notes. It really helps to understand the flow of data! #JavaScript #WebDev #API #CodingTips #LearningByDoing #TechNotes
To view or add a comment, sign in
-
-
✅ Solved LeetCode: Path Sum (112) — Alternative Approach Implemented a clean recursive (top-down) DFS solution in JavaScript using a subtractive strategy. Approach: - If the node is null, return false. - If the node is a leaf node, simply check: - root.val === targetSum - Otherwise: - Recursively call the function on left and right subtrees. - Pass targetSum - root.val to reduce the remaining required sum. - Return leftResult || rightResult. This approach eliminates the need for an external variable and keeps the recursion concise and expressive. Time Complexity: O(n) — each node is visited once Space Complexity: O(h) — recursion stack space (where h is tree height) A clean divide-and-conquer way to solve Path Sum efficiently! 🌳
To view or add a comment, sign in
-
More from this author
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