JavaScript, Check For Empty Array

How to check for an empty Array and why it is important? Make it a rule of thumb to check for an array to be a valid array and checking if it’s empty before iterating or accessing its elements. Take a look at the following function which iterates the array and returns the first element’s id. function getDataId(arr){return arr[0]['id']}console.log(getDataId([{id : 10}])); // 10console.log(getDataId([])); // Uncaught TypeError: Cannot read property 'id' of undefinedconsole. [Read More]

JavaScript, Replace All Occurrences Of String

How to replace all occurrences of string using JavaScript?

Let’s say you have the sentence, “Nory was a Catholic because her mother was a Catholic”

To replace all occurrences of Catholic word from the above sentence, you can make use of the String.replaceAll method.

let word = "Catholic";
let sentence = "Nory was a Catholic because her mother was a Catholic"
let new_sentence = sentence.replaceAll('Catholic','Jewish');
console.log(new_sentence)

// "Nory was a Jewish because her mother was a Jewish"

JavaScript, How To Get Month Name From Date

How do you get the month name from Date using JavaScript? Let’s have a look at how you can achieve it. Let’s create a date object using the current date time in JavaScript. let currentDateTime = new Date();console.log('current date is ', currentDateTime);// Output : Thu Nov 19 2020 16:23:58 GMT+0530 (India Standard Time)You can get the current month as a value using the inbuilt getMonth method on a Date object. [Read More]

Skills That Make You a Successful Python Developer

One of the most widely sought-after and used programming languages in the IT industry today is Python. There are just so many skills that one has to learn to become a good developer of Python, whether working with a software development company or working on some kind of development project. If you want to stay ahead of the competition, you have to be a good developer of the programming language. Let’s check out some skills that you need to succeed in this endeavor. [Read More]

How To Validate Angular Reactive Form

In this tutorial, you’ll learn how to validate the Angular Reactive Form. This is the third part of the Angular Material Reactive Form Tutorial Series. In the previous part, you learned how to create an Angular reactive form and get data from the form. So, let’s get started. Source code from this tutorial is available on GitHub. https://youtu.be/zqTD9D7seA0 Getting Started Let’s get started by cloning the source from the second part of the tutorial series. [Read More]

Angular : How To Unit Test Private Methods

In this quick tutorial, you’ll learn how to unit test private methods while writing test cases for Angular. Writing unit test for private methods and public methods is similar. But since you are unit testing an instance of an Angular component, you won’t be able to access the private method. Let’s take a look at the following Angular component code : import { Component } from '@angular/core';@Component({selector: 'app-root',templateUrl: '. [Read More]

How To Create Angular Material Reactive Form

In this tutorial, you’ll learn how to create Angular material Reactive Forms. This is the second part of the Angular Material Reactive Form Tutorial Series. In the first part, you learned how to install Angular material and use the components in the Angular project. Source code from this tutorial is available on GitHub. https://youtu.be/ebgnTuVNmzA Video Tutorial : How to Create Angular Reactive Forms Getting Started Let’s start from where we stopped in the first part. [Read More]

How to work with CollectionView in Xamarin Forms

The CollectionView is a flexible and coherent view to display the data list in different layouts for the Specifications view. It is swift and more flexible, which removes the concept of ViewCells. Difference between CollectionView and ListView CollectionView has a flexible layout, which allows the data to be present in vertically or horizontally, in a list or a grid. CollectionView supports the single and multiple selections in the list of data. [Read More]

Hosting Angular App On Clouding io

In this tutorial, you’ll learn how to host an Angular web application on Clouding.io cloud server. Before getting started with app development and hosting, let’s learn a bit about Clouding.io. Clouding.io is a VPS cloud server platform having sufficient years of experience in the industry. They provide powerful, stable and flexible cloud servers with high availability round the clock. They have a distributed storage system based on Solid State Drives. [Read More]

SMB File Shares: A Primer

Image Source File sharing is an essential part of our daily activities. You can share files between two network nodes, between a client and a server or between two nodes of different networks. All multi-user environments require a file sharing protocol, no matter which type of sharing you need. The SMB application layer network layer protocol is mostly used with the Windows operating system. This article reviews the features, benefits and use cases of this protocol. [Read More]