stackabuse.com

Promises in Node.js

Introduction JavaScript is single-threaded, which means that everything, including events, runs on the same thread. If the thread is not free, code execution is delayed until it is. This can be a bottleneck for our application since it can really cause serious performance problems. There are different ways by which we can overcome this limitation. In this article, we'll explore the modern way to handle asynchronous tasks in JavaScript - Promises. Callbacks and Callback Hell If you are a JavaScript developer, you've likely heard of, if not...

stackabuse.com

Spread Operator in JavaScript

Introduction In this tutorial, we'll explore one of the powerful features of the ES6 specification of JavaScript - the Spread Operator. Although the syntax is simple, sometimes the implementation is confusing if you do not understand it properly. In this tutorial, we'll demystify those three dots ... of JavaScript that does amazing things with iterables. Usages of the Spread Operator There are different usages of the spread operator and each usage target to solve a different problem statement. Expanding Arrays We can use the spread operator on...

stackabuse.com

Arrow Functions in JavaScript

Introduction If you are a JavaScript developer, you may know that JavaScript conforms to the ECMAScript (ES) standards. The ES6, or ECMAScript 2015 specifications, had introduced some of the revolutionary specifications for JavaScript, like Arrow Functions, Classes, Rest and Spread operators, Promises, let and const, etc. In this tutorial, we'll focus on Arrow functions, which is very much confusing and intimidating for JavaScript beginners. Arrow Function Syntax As we know, an ES5 function has the following syntax: function square(a) { ...

stackabuse.com

Angular Form Validation

Introduction One of the most common features in any web application is providing a form to users to input some data. You use forms daily to log in, register, place orders, etc. Processing user inputs before validating can have serious consequences. You may end up storing invalid data like an incorrect date, email, age, etc. It could also be a security issue due to attacks like Cross-Site Scripting (XSS). The traditional way to validate HTML forms is by using JavaScript or JQuery. Unfortunately, this approach warrants a bunch of code. Angular,...

stackabuse.com

Angular Form Validation

Introduction One of the most common features in any web application is providing a form to users to input some data. You use forms daily to log in, register, place orders, etc. Processing user inputs before validating can have serious consequences. You may end up storing invalid data like an incorrect date, email, age, etc. It could also be a security issue due to attacks like Cross-Site Scripting (XSS). The traditional way to validate HTML forms is by using JavaScript or JQuery. Unfortunately, this approach warrants a bunch of code. Angular,...