
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

4K+ Views
In this article, we will learn how to write a swift program to check if an array is empty. Here we use two methods: Using isEmpty property Using conditional statements Method 1: Using isEmpty Property To check if an array is empty Swift provides an isEmpty property. This property will return true if the given array is empty or return false if the given array is not empty. For example Arr = [3, 5, 6, 4, 6] so isEmpty property will return false. Syntax var isEmpty: Bool{get} Or you can also write it as − arrayName.isEmpty ... Read More

3K+ Views
In TypeScript, the type guards are used to determine a variable's type, often inside a conditional or functional block. The type guards usually take the variable and return a Boolean value or the variable type. Type guards allow you to tell the TypeScript compiler to infer a given type for a variable in a specific context, guaranteeing that an argument's type is what you say it is. Like feature detection, type guards are frequently used to limit a type and let you identify the proper prototypes, methods, and attributes of a value. As a result, handling that value became simple ... Read More

15K+ Views
The method overriding means writing the new definition of the method in the inherited class by keeping the method name, parameters, and return type the same. In this tutorial, we will learn about the method overriding in TypeScript. Inheritance is one of the four pillars of object-oriented programming. The method overriding feature of the OOPs is helpful with the inheritance. For example, we can define the method in the parent class and redefine the method with the same name, parameter, and return type into the base class with a different code to execute, and that’s how method overriding comes into ... Read More

9K+ Views
In TypeScript, the getters and setters are two terms that can be used to get and set the value of the class members, respectively. However, users can access the public members of the class directly via the dot operator by taking the object of the particular class as a reference. To access the class's private members, we just need to use the getter method. In this tutorial, we will learn to use the getters and setters in TypeScript. Using the getters to access the private members of the class As we create a method to access the class's private ... Read More

5K+ Views
In TypeScript, a 2D array is an array of arrays, where each inner array represents a row of the 2D array. You can access individual elements of the array using bracket notation, with the row and column indices separated by a comma. A single-dimensional array can store values of any data type, such as string, number, objects, etc. To sort a 2D array in TypeScript, you can use the sort() method along with a custom compare function. The sort() method takes the compare function as an optional argument, and the compare function should take two arguments, a and b, ... Read More

3K+ Views
In TypeScript, an array is a data type that represents a collection of elements. Each element in the array has a specific index, or position, in the array, and you can access or modify the elements in the array using their index. In TypeScript, an array can contain elements of the same or different data types. To push an element to the end of an array in TypeScript, you can use the push() method. This method adds the element to the end of the array and returns the new length of the array. Syntax Users can follow the syntax below ... Read More

4K+ Views
The string can contain a sequence of repeated and non-repeated characters. The length of the string means the total number of characters the string contains in the sequence of characters, including special characters, alphabetic characters, etc. Here, we will learn different methods to calculate the length of the string in TypeScript. Using the length property of the string In TypeScript, the string is a library, or we can say it is a class. It contains some properties and methods, which we can call by taking the string class object as a reference. The length is also the property of the ... Read More

7K+ Views
Functional programming languages such as TypeScript and JavaScript provide a way to handle errors using the try-catch blocks. The try block catches the errors, and the catch block handles the errors. In this tutorial, we will learn to handle errors in TypeScript. There are mainly 7 types of errors in TypeScript. Here, we will learn all types of errors one by one. Range error − If we try to access anything out of range, TypeScript will throw a range error. For example, accessing the array index for a large number value such as 10^100. Reference error − If we ... Read More

72K+ Views
It is common to show the date and time on the web or mobile application. As a user, have you ever seen any application which shows the date object as it is? It will never happen because it makes UX worst. So, we need to convert the date object to a string. After converting the date object to a string, we can format it according to our needs. The date format means ‘yyyy-mm-dd’, ‘dd-mm-yyyy’, etc. Also, we can do the same with the time string. We can display the hours, minutes, seconds, and milliseconds according to the need. In this ... Read More

3K+ Views
Decorators in TypeScript have programmatic access to the class definition process. Remember that a class description lists a class's properties, specified methods, and structure. The class instance is given access to these properties and methods when created. However, before a class instance is created, decorators allow us to add code to the definition of a class. They are equivalent to C# attributes or Java annotations. A decorator is a function that has a particular set of parameters. The JavaScript runtime automatically fills out these parameters, which give information about the class, method, or property to which the decorator has been ... Read More