Javascript Optimization Takeaway

Optimization takeaways Always instantiate your object properties in the same order so that hidden classes, and subsequently optimized code, can be shared. Adding properties to an object after instantiation will force a hidden class change and slow down any methods that were optimized for the previous hidden class. Instead, assign all of an object’s properties in its constructor. Code that executes the same method repeatedly … Continue reading Javascript Optimization Takeaway

Angular 7 Directives overview.

There are three kinds of directives in Angular: Components—directives with a template. Structural directives—change the DOM layout by adding and removing DOM elements. Attribute directives—change the appearance or behavior of an element, component, or another directive. Components are the most common of the three directives. You saw a component for the first time in the Getting Started. Structural Directives change the structure of the view. Two examples are NgFor and NgIf. … Continue reading Angular 7 Directives overview.

What is the difference between ‘extends’ and ‘implements’ keyword in TypeScript and Angular ?

In typescript (and some other OO languages) you have classes and interfaces. An interface has no implementation, it’s just a “contract” or “blueprint” of what members/method this type has.For example: Instances who implement this Point interface must have two members of type number: x and y, and one method distance which receives another Point instance and returns a number.The interface doesn’t implement any of those. Classes are the implementations: (code in playground) In your example … Continue reading What is the difference between ‘extends’ and ‘implements’ keyword in TypeScript and Angular ?

Hoisting in JavaScript

In this tutorial, we’ll investigate how the famed hoisting mechanism occurs in JavaScript. Before we dive in, let’s get to grips with what hoisting is. Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution. Inevitably, this means that no matter where functions and variables are declared, they are moved to the top of … Continue reading Hoisting in JavaScript

Javascript Engine and Look Inside it.

Founder: Brendan Eich Currently Used Compiler in Web Browsers are JIT (Just-In-Compiler). Chakra, SpiderMonkey, V8 are some the javascript engine used by Microsoft Edge,Firefox and Chrome respectively Compiler Vs Interpreter Compiler generates machine code by compiling the program without running it. It compiles whole program to run. Interpreter Generates bytecode that can be read by Javascript Engine to perform task. Also it runs on the … Continue reading Javascript Engine and Look Inside it.