Use of 'this' Keyword in TypeScript

Shubham Vora
Updated on 16-Jan-2023 15:22:55

8K+ Views

The “this” keyword is one of the most used keywords in TypeScript. For beginner TypeScript programmers, it’s complex to understand how this keyword works, but they will learn by the end of this tutorial. In this tutorial, we will learn to use this keyword in TypeScript. Syntax Users can follow the syntax below to use this keyword generally. Users can observe how we can access the variable or invoke the method using this keyword. this.var_name; this.method_name(); console.log(this.var_name); In TypeScript, this keyword refers to the global object if it’s not used inside any class or method. Even if we use ... Read More

Encode and Decode URL in TypeScript

Shubham Vora
Updated on 16-Jan-2023 15:20:52

18K+ Views

The URI stands for the uniform resource identifier. The URL is one of the most common URIS. We use the URL (uniform resource locator) to find the web page located on the internet. The web pages also contain resources. In simple terms, URI is a string containing some characters, and we can identify the physical and logical resources on the web using the URI. The URL is a subset of the URI, which stores the document address on the web. Reasons to Encode URI The first question that arises in your mind after reading this tutorial's title is why we ... Read More

Create Objects in TypeScript

Shubham Vora
Updated on 16-Jan-2023 15:19:07

18K+ Views

The object contains the key-value pairs of its properties, or it can be an instance of the class in TypeScript. The class and its objects are the base of object-oriented programming. So, without an object, OOPS doesn’t exist. Mainly, objects are used to invoke the non-static methods of the class. There are multiple ways to define the objects in TypeScript. We will learn all ways to define objects one by one below. Use The Object Literal Notation to Create Objects The object-literal notation means we can create the object using the two curly braces. By comma separation, we need to ... Read More

Create Abstract Classes in TypeScript

Shubham Vora
Updated on 16-Jan-2023 15:14:23

1K+ Views

Introduction to Abstraction We wanted readers to get familiar with abstract classes and the requirements of abstract classes before implementing them. The abstraction means hiding. It is used to hide the lower-level code implementation from users and some developers. Furthermore, it is used to show only the required information about the method rather than showing the whole complex implementation of methods. Create Abstract Classes We can use the abstract keyword to define the abstract classes or methods. The abstract classes can contain the normal and abstract types of methods. In the abstract class, we need to implement the functional or ... Read More

For...in Statement with Object in TypeScript

Shubham Vora
Updated on 16-Jan-2023 15:11:47

6K+ Views

In TypeScript, an object contains the properties and their values. We can use the for-in loop statement to iterate through every property of the objects and get its value. This tutorial will teach us to iterate through the object key-value pairs via different examples. Also, we will learn what kind of error we can get while iterating through the object properties and how to fix it quickly. Syntax Users can follow the syntax below to iterate through the iterable object properties using the for-in loop statement. For (var_name in object){ Statements or block to execute; } ... Read More

Setting ulimit Values on Docker Containers

Hemant Sharma
Updated on 16-Jan-2023 14:58:12

11K+ Views

Introduction Ulimit is a Unix/Linux utility that is used to set resource limits for processes running on the system. These limits can help prevent a single process from consuming too many resources, such as CPU or memory, and potentially impacting the overall performance of the system. To see the ulimit on your Linux machine, use the below command. $ ulimit –a Output real-time non-blocking time (microseconds, -R) unlimited core file size (blocks, -c) 0 data seg size ... Read More

Use Volume Sharing in Docker Swarm

Hemant Sharma
Updated on 16-Jan-2023 14:54:42

10K+ Views

Introduction Docker Swarm is a popular container orchestration platform that allows users to deploy and manage containers at scale. One of the key features of Docker Swarm is its support for volume sharing, which allows containers to access and share data stored in persistent volumes. In this article, we will explain what volumes are, how they are used in Docker Swarm and show examples of how volume sharing can be implemented in different scenarios. Prerequisite Basic knowledge of Docker and containerization Familiarity with Docker Swarm Understanding of volumes in Docker Experience with the command line What is Docker ... Read More

Run a Docker Image in IBM Cloud Functions

Hemant Sharma
Updated on 16-Jan-2023 14:49:41

312 Views

Introduction to Docker and IBM Cloud Functions Docker is a popular containerization platform that allows you to package applications and their dependencies into lightweight, portable containers. These containers can then be easily deployed and run on any machine with Docker installed, making it easy to manage and scale applications. IBM Cloud Functions is a serverless computing platform that allows you to run code in response to triggers such as HTTP requests, events, or data updates. IBM Cloud Functions can run a variety of languages, including JavaScript, Python, and Go, and it integrates seamlessly with Docker. Using Docker with IBM Cloud ... Read More

Move Docker Containers Between Different Hosts

Hemant Sharma
Updated on 16-Jan-2023 14:48:26

32K+ Views

Introduction Docker is a popular tool for building, deploying, and running applications in containers. One of the key benefits of using Docker is the ability to easily move containers between different hosts, whether they are local VMs, cloud servers, or on-premises datacentres. There are several methods available for moving Docker containers between different hosts, each with its own benefits and drawbacks. In this article, we will provide an overview of the various methods that are available and discuss the pros and cons of each. Methods for Moving Docker Containers Between Different Hosts Using docker save and docker load The docker ... Read More

Deploy Python Docker Image to AWS Lambda

Hemant Sharma
Updated on 16-Jan-2023 14:44:45

1K+ Views

Introduction AWS Lambda is a serverless computing platform that allows you to run your code without worrying about infrastructure. Docker is a tool used to package and deploy applications in a standardized and isolated manner. By deploying a Python Docker image to AWS Lambda, you can take advantage of both of these technologies to run your Python code at scale. Prerequisites AWS account with access to AWS Lambda Docker installation and basic knowledge of Docker commands Python application or code to be packaged in the Docker image Step 1: Building the Python Docker Image It would be best ... Read More

Advertisements