Posts for Javascript

Deven
Deven wrote

Creating a Reusable Class in JavasScript

In this article, you will learn to create a Reusable Class in Javascript. In Javascript Class is the template for creating objects. we can define a class is using a class declaration and To declare a class, we use the class keyword with the name of the class. Consider the example below to to create a Reusable […]

February 10, 2021 in Code examples
Deven
Deven wrote

JavaScript Clone an Array example

If you want to clone an Array in Javascript we can use the spread operator to expand our array into items and clone it into a new array: consider the following example: Another better approach is using  Array.slice() method with no arguments. consider the following example.

February 8, 2021 in Code examples
Deven
Deven wrote

JavaScript Check if Two Arrays Are Equal

In JavaScript to Check if two Arrays Are Equal the most simple approach is using a basic for loop with a counter. below is a simple example: In the code snippet above we sort our arrays before we test them for equality. The above code returns True in the console.

February 7, 2021 in Code examples
Deven
Deven wrote

Javascript Iterate Over All the Elements in an Array

In Javascript to Iterate Over All the Elements in an Array, we can use a functional approach. we can also use a for…of loop to Iterate Over All the Elements in an Array in the Javascript: we can also iterate over an array by passing a function to the Array.forEach() method.

February 7, 2021 in Code examples
Deven
Deven wrote

Javascript Check if an Object Is an Array

In JavaScript To check if an Object Is an Array we use the static Array.isArray() method. isArray() specifically checks for instances of the Array object. If we call it on a different type of collection like Map or Set, it returns false.

February 7, 2021 in Code examples

Build a Budget App with Html, Css, And JavaScript

The goal of this article is to teach beginners learning JavaScript, how to use JavaScript Object, JavaScript functions declaration and function invocation, and JavaScript DOM Manipulation. Before we start let us understand what is a budget?. I like to first understand the project I am about to work on before starting out. The reason is […]

July 17, 2020 in Javascript

Build a Crud application with JavaScript

In this tutorial, we will be looking at how we can create a Crud application with JavaScript. In the course of this article, we will create a Todo app. It is focused more on beginners learning javascript. A todo app is the most popular thing to build when learning a new programming language, and all you need […]

June 8, 2020 in Javascript & Tutorials

Build A REST Service With Fastify

Fastify is a high-performance HTTP framework for Node.js. Fastify focuses on speed, and it’s inspired by ExpressJS and HapiJS. In this article, we will learn how to build a RESTFUL service using Fastify by Creating a CRUD API with Fastify. Learning prerequisites Basic familiarity with Javascript. Nodejs installed on the development machine  MongoDB installed on […]

May 1, 2020 in Node & Tutorials

Understanding Technical concepts in JavaScript

One can always be a great driver without knowing how the automobile system operates. Similarly, you can be a good developer without understanding the inner workings of the JavaScript language. In this article, we will understand the difference between asynchronous and synchronous operations in JavaScript. Also, we will understand what meaning of this popular definition […]

March 10, 2020 in Code examples & Javascript

Understanding Firebase Realtime Database using React

Firebase has two types of database: Realtime Database and Cloud Firestore. Both databases are NoSQL-like databases so the database is structured as key-value pairs. In this tutorial, we’ll focus on the Realtime database and explore how the security rules secure the integrity of the data in our database. We will build a note-taking called Easi […]

February 20, 2020 in React & Tutorials

Avoiding side effects in JavaScript code

As developers, we tend to spend more time debugging our code than writing new features. Most times, this is due to the negligence of the side effects in our codebase. In this article, we will understand what side effects are and how side effects can be avoided. In programming, a function is a unit of […]

February 3, 2020 in Javascript & Tutorials

An Introduction to JavaScript Closures

Javascript provides the functionality of nested functions, returning a function, etc. These nested functions have access to the scope of its parent function.Consider the snippet below: function counter() { let value = 0; return function(incrementer) { value += incrementer; console.log(value) } } let myCount = counter(); myCount(4); // 4 myCount(4); // 8 In the above […]

January 28, 2020 in Code examples & Javascript

Improved Control Flow In JavaScript

This is nothing new in the language as this concept does the same thing that the normal if, else-if and else statement does but with a neat and less verbose syntax.  However, there are some cases that will be much easier to handle with the advanced control flow than the if, else-if and else statement. […]

January 27, 2020 in Code examples & Javascript

Build A Blog App with ExpressJs and SvelteJs

Svelte makes use of a new approach to building user interfaces. Instead of doing the necessary work in the browser, Svelte shifts that work to a compile-time phase that happens on the development machine when you’re building your app. In this article, We will build a simple blog application with expressjs and Sveltejs. Prerequisites Familiarity […]

January 22, 2020 in Svelte & Tutorials

working and Using Vuejs mixins

Using Vuejs mixins is a way to re-use functionality across multiple components in your web application. This is a good idea if you have multiple components sharing the same functionalities. Vuejs Mixins can contain any component options and when used, they are combined with the component’s options. How to use mixins in Vue Firstly, you […]

January 21, 2020 in Tutorials & Vue