<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Understanding Object-Oriented Programming in JavaScript]]></title><description><![CDATA[Understanding Object-Oriented Programming in JavaScript]]></description><link>https://oopsinjs99.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 17:53:07 GMT</lastBuildDate><atom:link href="https://oopsinjs99.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[📚 JavaScript Arrays 101]]></title><description><![CDATA[Imagine you want to store:

5 favorite movies

10 student marks

A list of daily tasks


You could create separate variables like this:
let movie1 = "Inception";
let movie2 = "Interstellar";
let movie]]></description><link>https://oopsinjs99.hashnode.dev/javascript-arrays-101-beginners-guide</link><guid isPermaLink="true">https://oopsinjs99.hashnode.dev/javascript-arrays-101-beginners-guide</guid><category><![CDATA[JavaScript #WebDevelopment #Programming #FrontendDevelopment #JavaScriptArrays #Arrays #LearnJavaScript #Coding #SoftwareDevelopment #JavaScriptForBeginners]]></category><dc:creator><![CDATA[Sheikh Ilyas Quadri]]></dc:creator><pubDate>Sun, 22 Feb 2026 10:45:46 GMT</pubDate><enclosure url="https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/6735777588a43a34d0f85c8f/74902dfb-7d85-49d5-8cb5-8ede07702b14.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Imagine you want to store:</p>
<ul>
<li><p>5 favorite movies</p>
</li>
<li><p>10 student marks</p>
</li>
<li><p>A list of daily tasks</p>
</li>
</ul>
<p>You <em>could</em> create separate variables like this:</p>
<pre><code class="language-plaintext">let movie1 = "Inception";
let movie2 = "Interstellar";
let movie3 = "Avatar";
</code></pre>
<p>But what if you have 100 values?</p>
<p>That’s messy.</p>
<p>This is where <strong>arrays</strong> help.</p>
<hr />
<h1>📌 What Are Arrays?</h1>
<p>An <strong>array</strong> is a collection of multiple values stored in a single variable.</p>
<p>Think of it like a row of boxes:</p>
<pre><code class="language-plaintext">[ value, value, value, value ]
</code></pre>
<p>Arrays store values in <strong>order</strong> and each value has a position called an <strong>index</strong>.</p>
<hr />
<h1>🏗️ How to Create an Array</h1>
<p>We use square brackets <code>[]</code> to create an array.</p>
<h3>Example: List of Fruits</h3>
<pre><code class="language-plaintext">let fruits = ["Apple", "Banana", "Mango", "Orange"];
</code></pre>
<p>Now all fruits are stored inside one variable.</p>
<p>Much cleaner than creating 4 separate variables.</p>
<hr />
<h1>📊 Visual Representation of an Array</h1>
<pre><code class="language-plaintext">Index:   0        1        2        3
        --------------------------------
Value:  Apple   Banana   Mango   Orange
</code></pre>
<p>⚠ Important: Indexing starts from <strong>0</strong>, not 1.</p>
<p>That’s very important in JavaScript.</p>
<hr />
<h1>🔎 Accessing Elements Using Index</h1>
<p>To access a value, use its index number.</p>
<pre><code class="language-plaintext">let fruits = ["Apple", "Banana", "Mango"];

console.log(fruits[0]);  // Apple
console.log(fruits[1]);  // Banana
</code></pre>
<p>Structure:</p>
<pre><code class="language-plaintext">fruits[index]
</code></pre>
<p>If you try to access a non-existing index:</p>
<pre><code class="language-plaintext">console.log(fruits[10]);
</code></pre>
<p>It will return:</p>
<pre><code class="language-plaintext">undefined
</code></pre>
<hr />
<h1>🔄 Updating Array Elements</h1>
<p>You can change values using index.</p>
<pre><code class="language-plaintext">let fruits = ["Apple", "Banana", "Mango"];

fruits[1] = "Grapes";

console.log(fruits);
</code></pre>
<p>Before:</p>
<pre><code class="language-plaintext">["Apple", "Banana", "Mango"]
</code></pre>
<p>After:</p>
<pre><code class="language-plaintext">["Apple", "Grapes", "Mango"]
</code></pre>
<p>Arrays are mutable — meaning values can be changed.</p>
<hr />
<h1>📏 The <code>length</code> Property</h1>
<p>To know how many elements are in an array, use <code>.length</code>.</p>
<pre><code class="language-plaintext">let fruits = ["Apple", "Banana", "Mango"];

console.log(fruits.length);
</code></pre>
<p>Output:</p>
<pre><code class="language-plaintext">3
</code></pre>
<p>Useful when looping through arrays.</p>
<hr />
<h1>🔁 Looping Over Arrays</h1>
<p>To print all elements, we can use a simple <code>for</code> loop.</p>
<pre><code class="language-plaintext">let fruits = ["Apple", "Banana", "Mango"];

for (let i = 0; i &lt; fruits.length; i++) {
  console.log(fruits[i]);
}
</code></pre>
<p>How it works:</p>
<ol>
<li><p>Start from index 0</p>
</li>
<li><p>Continue until <code>i &lt; fruits.length</code></p>
</li>
<li><p>Print each element</p>
</li>
</ol>
<hr />
<h1>🧠 Memory-Style Block Diagram</h1>
<p>Think of array storage like this:</p>
<pre><code class="language-plaintext">fruits
   ↓
 -------------------------
 | Apple | Banana | Mango |
 -------------------------
    0        1        2
</code></pre>
<p>Each value occupies a position in memory.</p>
<hr />
<h1>🆚 Individual Variables vs Array</h1>
<h3>❌ Without Array</h3>
<pre><code class="language-plaintext">let mark1 = 85;
let mark2 = 90;
let mark3 = 78;
</code></pre>
<p>Hard to manage.</p>
<hr />
<h3>✅ With Array</h3>
<pre><code class="language-plaintext">let marks = [85, 90, 78];
</code></pre>
<p>Cleaner. Scalable. Easier to loop.</p>
<hr />
<h1>💡 Final Thoughts</h1>
<p>Arrays are one of the most important data structures in JavaScript.</p>
<p>They are used in:</p>
<ul>
<li><p>Storing API data</p>
</li>
<li><p>Managing lists</p>
</li>
<li><p>Working with loops</p>
</li>
<li><p>Building real-world applications</p>
</li>
</ul>
<p>If you understand:</p>
<ul>
<li><p>Indexing</p>
</li>
<li><p>Updating</p>
</li>
<li><p>Length</p>
</li>
<li><p>Looping</p>
</li>
</ul>
<p>You’re building strong fundamentals.</p>
<p>Advanced array methods (map, filter, reduce) come next — but mastering the basics first is very important.</p>
]]></content:encoded></item><item><title><![CDATA[🏗️ Understanding Object-Oriented Programming (OOP) in JavaScript]]></title><description><![CDATA[When projects grow bigger, writing everything as separate variables and functions becomes messy.
That’s where Object-Oriented Programming (OOP) helps.
OOP is a programming style where we organize code]]></description><link>https://oopsinjs99.hashnode.dev/understanding-object-oriented-programming-in-javascript</link><guid isPermaLink="true">https://oopsinjs99.hashnode.dev/understanding-object-oriented-programming-in-javascript</guid><category><![CDATA[JavaScript #WebDevelopment #Programming #ObjectOrientedProgramming #OOP #JavaScriptClasses #LearnJavaScript #Coding #SoftwareDevelopment #FrontendDevelopment]]></category><dc:creator><![CDATA[Sheikh Ilyas Quadri]]></dc:creator><pubDate>Sun, 22 Feb 2026 10:40:30 GMT</pubDate><enclosure url="https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/6735777588a43a34d0f85c8f/4140f463-63be-4c05-80bc-a4840be25f22.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When projects grow bigger, writing everything as separate variables and functions becomes messy.</p>
<p>That’s where <strong>Object-Oriented Programming (OOP)</strong> helps.</p>
<p>OOP is a programming style where we organize code using <strong>objects and classes</strong>.</p>
<hr />
<h1>📌 What is Object-Oriented Programming (OOP)?</h1>
<p>Object-Oriented Programming is a way of writing code using:</p>
<ul>
<li><p>Classes (blueprints)</p>
</li>
<li><p>Objects (real instances)</p>
</li>
<li><p>Properties (data)</p>
</li>
<li><p>Methods (functions inside objects)</p>
</li>
</ul>
<p>It helps in:</p>
<ul>
<li><p>Organizing code</p>
</li>
<li><p>Reusing code</p>
</li>
<li><p>Making programs scalable</p>
</li>
</ul>
<hr />
<h1>🚗 Real-World Analogy: Blueprint → Objects</h1>
<p>Think about a <strong>car factory</strong>.</p>
<p>A company creates a <strong>blueprint</strong> for a car.</p>
<p>From that blueprint, they manufacture:</p>
<ul>
<li><p>Car 1</p>
</li>
<li><p>Car 2</p>
</li>
<li><p>Car 3</p>
</li>
</ul>
<p>Each car has:</p>
<ul>
<li><p>Brand</p>
</li>
<li><p>Color</p>
</li>
<li><p>Speed</p>
</li>
</ul>
<p>The blueprint is like a <strong>class</strong>.<br />Each manufactured car is an <strong>object</strong>.</p>
<hr />
<h1>📊 Blueprint → Object Diagram</h1>
<pre><code class="language-plaintext">        Class (Blueprint)
              ↓
        ----------------
        |   Car Class  |
        ----------------
           ↓       ↓       ↓
        Car1    Car2    Car3
       (Object) (Object) (Object)
</code></pre>
<p>One blueprint → Multiple objects.</p>
<hr />
<h1>🏛️ What is a Class in JavaScript?</h1>
<p>A <strong>class</strong> is a template used to create objects.</p>
<p>In JavaScript, we use the <code>class</code> keyword.</p>
<hr />
<h2>🔹 Example: Creating a Class</h2>
<pre><code class="language-plaintext">class Person {
  constructor(name, age) {
    this.name = name;
    this.age = age;
  }

  greet() {
    console.log("Hello, my name is " + this.name);
  }
}
</code></pre>
<p>Let’s break it down.</p>
<hr />
<h1>🧱 Constructor Method</h1>
<p>The <code>constructor</code> is a special method that runs automatically when we create a new object.</p>
<p>It is used to initialize properties.</p>
<pre><code class="language-plaintext">constructor(name, age) {
  this.name = name;
  this.age = age;
}
</code></pre>
<p><code>this</code> refers to the current object.</p>
<hr />
<h1>🧍 Creating Objects from a Class</h1>
<p>Now we create objects using the <code>new</code> keyword.</p>
<pre><code class="language-plaintext">let person1 = new Person("Ilyas", 21);
let person2 = new Person("Rahul", 22);
</code></pre>
<p>Now we have two different objects created from the same class.</p>
<hr />
<h1>🔧 Calling Methods</h1>
<pre><code class="language-plaintext">person1.greet();
person2.greet();
</code></pre>
<p>Output:</p>
<pre><code class="language-plaintext">Hello, my name is Ilyas
Hello, my name is Rahul
</code></pre>
<p>Each object has its own data but shares the same structure.</p>
<hr />
<h1>📊 Class → Instance Relationship</h1>
<pre><code class="language-plaintext">Class: Person
   ↓
person1 → { name: "Ilyas", age: 21 }
person2 → { name: "Rahul", age: 22 }
</code></pre>
<p>Class defines structure.  </p>
<p>Objects store actual data.</p>
<hr />
<h1>🧠 Methods Inside a Class</h1>
<p>Methods are functions written inside a class.</p>
<p>Example:</p>
<pre><code class="language-plaintext">class Car {
  constructor(brand, color) {
    this.brand = brand;
    this.color = color;
  }

  drive() {
    console.log(this.brand + " is driving.");
  }
}
</code></pre>
<p>Here:</p>
<ul>
<li><p><code>brand</code> and <code>color</code> → properties</p>
</li>
<li><p><code>drive()</code> → method</p>
</li>
</ul>
<hr />
<h1>🔒 Basic Idea of Encapsulation</h1>
<p>Encapsulation means:</p>
<p>👉 Keeping data and related methods together inside a class.</p>
<p>Instead of writing:</p>
<pre><code class="language-plaintext">let name = "Ilyas";
let age = 21;

function greet() {
  console.log("Hello " + name);
}
</code></pre>
<p>We organize it like this:</p>
<pre><code class="language-plaintext">class Person {
  constructor(name, age) {
    this.name = name;
    this.age = age;
  }

  greet() {
    console.log("Hello " + this.name);
  }
}
</code></pre>
<p>Everything related to a person stays inside the <code>Person</code> class.</p>
<p>That’s cleaner and more organized.</p>
<hr />
<h1>🎯 Why OOP is Powerful</h1>
<ul>
<li><p>Code becomes reusable</p>
</li>
<li><p>Easy to manage large projects</p>
</li>
<li><p>Clear structure</p>
</li>
<li><p>Real-world modeling becomes easier</p>
</li>
</ul>
<p>Instead of rewriting logic, we reuse the class.</p>
<hr />
<h1>🎯 Mini Assignment</h1>
<h3>1️⃣ Create a Student class</h3>
<pre><code class="language-plaintext">class Student {
  constructor(name, age) {
    this.name = name;
    this.age = age;
  }

  printDetails() {
    console.log("Name: " + this.name + ", Age: " + this.age);
  }
}
</code></pre>
<hr />
<h3>2️⃣ Create multiple student objects</h3>
<pre><code class="language-plaintext">let student1 = new Student("Aman", 20);
let student2 = new Student("Priya", 21);

student1.printDetails();
student2.printDetails();
</code></pre>
<p>You just created reusable student objects.</p>
<hr />
<h1>💡 Final Thoughts</h1>
<p>Object-Oriented Programming helps you:</p>
<ul>
<li><p>Structure code properly</p>
</li>
<li><p>Avoid repetition</p>
</li>
<li><p>Build scalable applications</p>
</li>
<li><p>Model real-world systems</p>
</li>
</ul>
<p>Almost all modern frameworks (React, Angular, Node.js apps) rely heavily on OOP concepts.</p>
<p>Master this, and your JavaScript level jumps significantly.</p>
]]></content:encoded></item></channel></rss>