Mastering JavaScript Objects and Prototypal Inheritance

Introduction to JavaScript Objects

In JavaScript, an object is a self-contained environment that stores data as a collection of properties and methods. A property is an association between a name (or key) and a value, while a method is a function associated with an object.

Think of an object as a real-world entity. For example, a Car is an object. It has properties like color, brand, and weight, and methods like start, drive, and brake.

// A simple conceptual look at an object
let car = {
    brand:
Read More

.NET Framework and C# Programming Fundamentals

Unit I: Framework of .NET

1. Building Blocks of the .NET Platform

The .NET platform is built on important components that provide support for application development and execution. The Common Language Runtime (CLR) is the execution environment of .NET that manages memory, security, exception handling, and program execution. The Common Type System (CTS) defines rules for declaring and using data types so that different .NET languages can interact smoothly. The Common Language Specification (CLS) provides

Read More

JavaScript Programming Exercises and Code Examples

Fee Payment Logic

let feePaid = true;
let underLimitAbsences = true;
let canTakeExam = feePaid && underLimitAbsences;
console.log(canTakeExam);

Grading System

let nota;
let piket = 100;
if (piket > 100) {
  console.log("Piket nuk jane te sakta");
} else if (piket >= 95) {
  nota = 10;
} else if (piket >= 85) {
  nota = 9;
} else if (piket >= 75) {
  nota = 8;
} else if (piket >= 65) {
  nota = 7;
} else if (piket >= 55) {
  nota = 6;
} else if (piket >= 45) {
  nota = 5;
Read More

C++ OOP Fundamentals: Classes, Objects, and Encapsulation

C++ was originally called “C with Classes” because its primary purpose was to add Object-Oriented Programming (OOP) features to the C language. Here is a detailed breakdown of these core object-oriented features.

1. Core OOP Concepts

Classes and Objects

  • Class: A user-defined data type that acts as a blueprint or template for creating objects. It defines data (attributes) and functions (behavior) grouped together.
  • Object: An instance of a class. When a class is defined, no memory is allocated, but memory
Read More

Internet vs. World Wide Web: Key Differences Explained

Internet vs. World Wide Web: The Core Differences

The Internet and the World Wide Web (WWW) are often used interchangeably, but they are two distinct technologies. In short: the Internet is the highway, and the World Wide Web is the traffic that drives on it.

1. What is the Internet?

The Internet is a global network of interconnected computers and physical infrastructure. It is the underlying hardware and software framework that allows devices worldwide to communicate.

  • The Infrastructure: Millions of
Read More

Computer Graphics: Points, Lines, and Clipping Algorithms

Fundamental Elements: Points and Lines

Point: A point is the simplest graphical element. It represents a single position in a coordinate system and has no length, width, or height. A point is represented by a pair of coordinates: P(x, y), where x is the horizontal position and y is the vertical position.

Example: Point P(4, 5) indicates a position located 4 units along the x-axis and 5 units along the y-axis.

Characteristics of a Point

  • It has only position and no dimensions.
  • It is represented by coordinates.
Read More