We will learn about the tuple types in TypeScript. In JavaScript, an array can contain elements of different data types. Still, as TypeScript is a superset of JavaScript and type-strict language, a TypeScript array can contain only single types of elements. So, the tuple allows us to store elements of the different data types in the TypeScript array. Also, when we store elements inside the tuple, the order of elements is important; Otherwise, the TypeScript compiler can generate an error while compiling the code. Syntax You can follow the syntax below to define the tuples in TypeScript. let sample_tuple: [string, ... Read More
The Symbol is introduced in the last main revision of JavaScript, ES6. The Symbol is a data type. As we use the number, string, or Boolean to create the variables of different data-type, we can use the symbol type to create the Symbol. Using the symbol types has many benefits as it provides more features than other data types. In this tutorial, we will learn about the basics of the Symbol and its different uses of the Symbol. Syntax Users can follow the syntax below to create a variable of symbol data type. let test_symbol = Symbol(); let key_symbol = ... Read More
We will learn to extract unique objects by attribute from an array of objects in this tutorial. Sometimes, we need to filter objects from the array of objects based on a particular attribute. For example, we have an id as a key to identify the object. So, we need to ensure that the array contains only a single object with a single id. If two or more objects contain the same primary key value, it can cause the problem of uniquely identifying objects. Here, we will learn different approaches to filter all unique objects from the array based on a ... Read More
In JavaScript, various scopes allow us to access the functions and variables from different places in our code. We will learn about the function scope in this tutorial. Also, we will explore the different types of function expressions in JavaScript. Function Scope When we create a new function in JavaScript, it also creates the scope for that particular function. It means that whatever variables we declare inside the function or define the nested function inside it, we can only access it inside the function block. If we try to access the variables defined inside the function block from outside the ... Read More
This tutorial will teach about the ‘in’ operator in JavaScript. There are many operators available in JavaScript, such as arithmetic operators to perform mathematical operations, assignment operators, equality operators, etc. The ‘in’ operator is also one of them, which we can use to find properties from the object. Before we start, let me ask you a question. Have you ever needed to check for the existence of the object's properties while coding with JavaScript? If yes, how did you deal with it? The answer is simple you can use the ‘in’ operator, which returns the Boolean value based on whether ... Read More
There are mainly two programming paradigms: The imperative programming paradigm and the declarative programming paradigm. Functional programming is a subtype of the declarative paradigm. The paradigm word refers to the approach to solving a particular problem. Functional programming has been in use for the last decades but came in the trend after 2015 when the last main revised version of JavaScript was released. There are many benefits to using functional programming, which we will discuss in this tutorial. Different Concepts of Functional Programming and their benefits Functional programming works as mathematical function works. It allows developers to develop software based ... Read More
In JavaScript, developers used the prototype to inherit the function with another function in ES5. In the ES6, classes introduced in JavaScript can be used for inheritance as other programming language does. What are sub-classes and inheritance? As the subclass word represents, it is a child class of another class. We can use inheritance to create or derive a subclass from the superclass, and we can call the class to a superclass from which we derive the class and the sub-class to the derived class. The subclass contains all the properties and methods of the superclass, and we can access ... Read More
In TypeScript, classes are the template that defines the variables and methods. We can use class templates to create objects, which means the class is the reusable component in object-oriented programming, and we can reuse it by creating its object. We can use the ‘interface’ keyword to define the interfaces in TypeScript. The interface contains the class structure. The interface is similar to abstract classes we define in other programming languages, such as Java and C++. It contains only the declaration of variables with their type and method with its return type and parameter types. Classes define the interface's methods ... Read More
SQL, or Structured Query Language, is a programming language used for managing and manipulating relational databases. It is the standard language for relational database management systems, such as MySQL, Oracle, and Microsoft SQL Server. In this article, we will explore the characteristics of SQL and how they make it a powerful tool for working with databases. Introduction to SQL SQL is a declarative programming language, meaning that it is used to describe the desired outcome rather than the specific steps to achieve it. This makes it a powerful tool for working with databases because it allows users to focus on ... Read More
Since smartphones are so close to people, mobile app development has begun to influence the world. A combination of languages, primarily JavaScript, CSS, and HTML, is utilized to construct all types of coding. The development of mobile apps is now one of the most crucial areas of current technology developments. The process of creating a mobile app involves a variety of technologies and procedures. Coding, which uses a range of languages to accomplish the process, is one of the most crucial components. JavaScript is a computer language that developers like due to a wide range of advantages. Major developers always ... Read More