Map Hold key-value pairs Remember the order of insertion. Can have objects or primitive values as key or value. Map is a JavaScript object which can hold key-value pairs  and remember the order of insertion. Maps inherit from  Map.prototype. Map.prototype.constructor returns the constructor function that created an instance’s prototype. A new Map is created using the map constructor in the following way. [crayon-5dcf4adcb461146107736...

Security is the biggest concern while building web applications. Most of the web applications handle a lot of sensitive data and it is necessary to provide adequate security to protect this data from perpetrators. This series of articles discuss various security issues, types of attacks and guidelines to be followed for building a  secure application. Front-end    The basic security features that should be implemented in every web applica...

While working with Node.js and Angular, sometimes you might need to set some custom values in Response Header from the server-side and get these values in your Angular application. These values can be some tokens, keys or anything. This article is about completing this requirement. Server-side using Express.js and Node.js To set a custom value in the response header, you have to write the following code in your Express.JS server [crayon-5dcf4adc...

1 What is typescript? It is a strict syntactical superset of JavaScript, and adds optionaltype-checking along with the latest ECMAScript features. 2 What is two way data binding in angular? Two-way Binding. Data binding in AngularJS is the synchronization between the model and the view. When data in the model changes, the view reflects the change, and when data in the view changes, the model is updated as well. Binding   3 Types of bindings ...

While creating AngularJS applications,we might need to send multiple  http requests to backend apis to fetch the data that need to be populated within our HTML.In most cases, these backend apis might be protected using token .Also we might need to add a loading image to indicate the user that the data is being fetched. HttpInterceptor helps us to a display the loader image before and hide the loader image after completing the request  and also...

Angular 1.6 SPA server side pagination of data with sort. To create a SPA which lists user data with pagination  and sorting we need the following CDN links – Angular JS 1.6.9 js CDN. – Angular JS UI bootstrap -Bootstrap components written in pure AngularJS . – Bootstrap CSS file. STEP 1 – Create file index.html and add the relevant CDN links using the following codes. [crayon-5dcf4adcb706d911423984/] STEP 2 – CREA...

HttpInterceptor –  feature in Angular 4.3. We may need to intercept Http request while building apps with Angular. Sometimes we may you need to intercept Http request to add something to request header or to do something with the response. We can use Http Interceptor to do some action when sending  a request.This can be achieved using  the following interceptor class which implemenets Httpinterceptor.The interceptor adds an ‘acces...

Node.js is an open source server environment which lets us write server side code in javascript. Node.js is asynchronous,single threaded and non-blocking .Node.js has very high memory efficiency which makes it very popular in server side  developement for web/mobile app.In this article we take a look at how to start of web developement in Node.js with Mysql as database. To install Node.js in your linux run the following command in the terminal [...

Filter function in javascript filters an array based on a given criteria and returns new array.For example if we want to get all elements in an array divisible by 2 as a new array,we can use filter function [crayon-5dcf4adcbad01775546271/] Just for a reference check what the map function gives in return [crayon-5dcf4adcbad0b351754196/]   Now lets’s go back to filter function.Lets see how filter function works on array of objects. [cray...

  Javascript strings are immutable.But javascript objects and arrays are mutable.A mutable object is an object whose content can be modified after it is created. An immutable object is an object whose content cannot be modified after it is created. Consider an the following example [crayon-5dcf4adcbb67a285719060/] Now,from the above we realize that arrays and objects in javascript are mutable,ie they can be mutated. Functions like slice retu...



js/nodejs/angularjs/ts interview questions
interview questions / May 31, 2018

1  What is data binding in angularjs Data binding in AngularJS is the synchronization between the model and the view.                                      2  What are the key features of angularjs    Modules.    Directives.    Expressions.    Controller.    Scope.    Data Binding.    Validations.    Filters.    Services.  Routing.  Dependency Injection.  Testing. 3  What are directives AngularJ...

js (ES6,ES7,ES8),OOPS js,Node.js
Javascript / May 31, 2018

ABOUT JAVASCRIPT JavaScript  is an interpreted language.A program such as C++ or Java needs to be compiled before it is run. The source code is passed through a program called a compiler, which translates it into bytecode that the machine understands and can execute. In the case of javascript  an interpreter  reads over the JavaScript code, interprets each line and runs it.Google’s V8 increases performance by compiling...

Angularjs and ts(Angular 5)
Javascript / May 31, 2018

WHAT IS ANGULAR JS AngularJS is a JavaScript framework. It is written in JavaScript.AngularJS extends HTML attributes with DIRECTIVES, and binds data to HTML with EXPRESSIONS.With AngularJS we can create single page applications(SPA) The following are the key features of AngularJs: Modules. Directives. Expressions. Controller. Scope. Data Binding. Validations. Filters. Services. Routing. Dependency Injection. Testing. [crayon-5dcf4adca...

Understanding ‘this’ in Javascript
interview questions , Javascript / March 20, 2018

This in Javascript refers to the object to which the function belongs. The value of this is determined by how a function is called.’This’ refers to the “owner” of the function.In the case of a normal function like below ‘this‘ refers to the global object (window object) [crayon-5dcf4adca86a5596764112/] In the above example, a function WrapAll() is being called from the global scope. The global scope ...

Fat arrow functions or arrow functions in Javascript
interview questions , Javascript / February 20, 2018

Arrow Functions primarly have two big advantages 1 They let us provide a shorter way to define functions 2  Arrow functions does not have their own  this, arguments(JavaScript functions have a built-in object called the arguments object), super, or new.target. These functions cannot be used as constructors.Arrow functions does not have their own this and it will have this value from their enclosing context .We can use this from th...