Angular Lifecycle Hooks

In this article, we will know about the lifecycle of Angular components. Since, in Angular, a component is the main building block of the application, it is very important to understand the lifecycle processing steps of the components so that we can understand the...
Read More ⟶

CaesarCipher string manipulation

function CaesarCipher(str,num) { if(num < 0) { return CaesarCipher(str, num + 26); } let output = ""; for(let i=0; i<str.length; i++) { let c = str[i]; if(c.match(/[a-z]/i)) { let code = str.charCodeAt(i); if(code >=...
Read More ⟶

Sorting Algorithms

Sorting an array with an higher order function now a days is very easy. let x = [2,5,8,1,3] x.sort() //[1,2,3,5,8] Now doing same thing with vanilla JavaScript algorithms. let a = [5,2,1,3,7,100]; let Alen = a.length; let ans = []; for(let...
Read More ⟶

Reverse an Array using JavaScript

This article I am going to show you the different way you can reverse an Array. Array is a group of similar item, number etc that is store in single variable. For eg: let arr1 = [1,2,3]; This is an array example with a group of numbers. There are multiple...
Read More ⟶

Create Pyramid structure from javascript

Create Pyramid structure from JavaScript simple nested loop var rows = 10 for(var i=0; i<=rows; i++){ for(var k=1; k<=rows-i; k++){ document.write(" ") } for(var j=0; j<=i; j++) { document.write("*...
Read More ⟶

HTML5 default validation for confirm password

Hello guys, In this section, I am going to show you how you can easily validating HTML5 default validation for confirm the password. Generally in HTML5 when you create a form you simply write “required” attribute to the form element and it starts validating...
Read More ⟶

Nested Loop javascript

Simple nested loop javascript code var person = [{ name : [ {firstName: "Ravi", lastName: "Kumar"} ], id : 5566 },{ name: [ {firstName: "John", lastName: "Braman"} ], id : 96 }]; var item, text; text="<table...
Read More ⟶

Basic simple calculator

In this tutorial I am going to show you how to design a basic simple calculator with few HTML codes. Generally building of calculator seems to be very hard work and lots of code. But it is not true when we have powerful markup language like HTML (Hyper Text Markup...
Read More ⟶

javascript function keyboard key

With javascript we can control the function of keyboard key. Its necessary sometimes when we have to create an event on clicking some specific key. In this post we are going to learn how to handle javascript funciton keyboard key. How to use javascript function...
Read More ⟶

javascript redirect code

With below javascript redirect code, you can easily redirect your current page to any pages you desire. Simple Javascript redirect code copy and paste it into your page where you want to redirect on load. <script type=”text/javascript”> window.location =...
Read More ⟶