Swift Objects: Understanding Object-Oriented Programming in Swift

Introduction Welcome to the Swift Objects tutorial, which is part of our Swift series. In Swift, everything is treated as an object, even basic values like numbers. This means that every value can receive messages and have associated functions called methods. Messages and Methods In Swift, each type can have multiple methods associated with it. For example, the number value 8 has a isMultiple method that can be called to check if it is a multiple of another number....

Swift Structures - The Fundamentals of Swift Structures

Structures are a fundamental concept in Swift programming. They are widely used and even the built-in types in Swift are implemented as structures. In Swift, we can create instances of structures, which are known as objects. In most programming languages, objects can only be created from classes. However, Swift provides the flexibility to create objects from structures as well. In fact, the official documentation recommends using structures whenever possible because they are easier to work with....

Understanding the JavaScript Super Keyword

When developing with classes in JavaScript, you often come across the super keyword. In this blog post, let’s explore the purpose and usage of super. Let’s start with a simple example. We have a class called Car: class Car { constructor() { console.log('This is a car'); } } The constructor method in a class is special because it is executed when the class is instantiated. For example: const myCar = new Car(); //'This is a car' Now, let’s say we have a class called Tesla that extends the Car class:...