๐——๐—ฎ๐˜† ๐Ÿฎ๐Ÿฑ ๐—ผ๐—ณ ๐— ๐—˜๐—ฅ๐—ก ๐—ฆ๐˜๐—ฎ๐—ฐ๐—ธ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป๐—ถ๐—ป๐—ด

I spent today studying Object-Oriented Programming in JavaScript.

I focused on how objects share properties through Prototypes. This knowledge helps you structure better programs.

One major concept I learned is the this keyword.

In an object method, this refers to the object itself. It lets functions access properties inside that same object.

Example:

const student = { name: "Ali Hamza", marks: 95, printMarks: function() { console.log("Marks =", this.marks); } };

In this example, this points to the student object. It pulls the marks value directly from the object.

Understanding this makes your code more efficient.

Source: https://dev.to/ali_hamza_589ec7b3eb6688d/day-25-of-learning-mern-stack-2npf