Posts

Showing posts from April, 2020

JavaScript Inheritance and Prototype # OOPS JS

Image
Introduction to Inheritance and Prototype Chain in JavaScript Introduction This article explains inheritance and the Prototype Chain in JavaScript. JavaScript is a bit confusing for developers experienced in class-based languages (like Java or C++), since it is dynamic and does not provide a class implementation (although the keyword class is a reserved keyword and cannot be used as a variable name). When it comes to inheritance, JavaScript only has one construct: objects. Each object has an internal link to another object called its prototype. That prototype object has a prototype of its own, and so on until an object is reached with null as its prototype. null, by definition, has no prototype, and acts as the final link in this prototype chain. In JavaScript, a prototype is a property of a function and the object created by constructor functions. The prototype of a function is an object. It's main use is when a function is used as a constructor. Prototype and prop

12 Concepts That Will Level Up Your JavaScript Skills

Image
12 Concepts That Will Level Up Your JavaScript Skills This article tackles 12 concepts that are critical for any JS developer to understand, but in no way represents the full breadth of what a JS developer should know. JavaScript is a complex language. If you’re a JavaScript developer at any level, it’s important to understand its foundational concepts. 1. Value vs. Reference Variable Assignment Understanding how JavaScript assigns to variables is foundational to writing bug-free JavaScript. If you don’t understand this, you could easily write code that unintentionally changes values. JavaScript  always  assigns variables by value. But this part is  very  important: when the assigned value is one of JavaScript’s five primitive type (i.e.,  Boolean ,  null ,  undefined ,  String , and  Number ) the actual value is assigned. However, when the assigned value is an  Array ,  Function , or  Object  a  reference to the object in memory  is assigned. Example time! In the follo

Understanding JSON Web Token Authentication

Image
Understanding JSON Web Token Authentication In this article, you'll learn the ‘Why’, ‘What’ and ‘How’ for Authentication in Web App using JWT (JSON Web Token) When making a website, you may have come across an array of problems. Among which,  authentication  while logging in a User, comes as a major headache to developers, primarily to those who are just starting out. Tokens and Sessions were created to ease with this very problem. A  Token  is a piece of data that has no meaning or use on its own, but when combined with the correct  Tokenization system (a  process of replacing sensitive data with unique identification symbols that retain all the essential information about the data without compromising its security ) becomes a powerful tool for authentication. Whereas, a  Session  is a system to manage the duration after which a user is logged out automatically. Usually, we use HTTP protocols while developing and browsing web applications. For proper implementation o

Functional Programming for JavaScript Developers

Image
Functional Programming for JavaScript Developers Learn functional programming and how it enables developers to move from imperative to declarative programming Improve your code with functional patterns like pure functions, compose & map/reduce/filter...plus advanced concepts like fusion, transducing and monads! Solidify your knowledge of functional JavaScript programming, including objects, arrays, and prototypes Learn higher-order functions, closures, scope, master key functional methods like map, reduce and filter and promises and ES6+ asynchronous JavaScript. Go beyond the fundamentals of asynchronous JavaScript and use features and techniques that will help you reduce code and create smarter applications. Learning how to build and manage asynchronous functional programs is perhaps the most important part of becoming an effective JavaScript programmer. What you'll learn On the surface, this course is designed for beginning and intermediate JS developers who

Difference between Regular and Arrow Functions in JavaScript

Image
Difference between Regular and Arrow Functions in JavaScript Arrow functions – a new feature introduced in ES6 – enable writing concise functions in JavaScript. While both regular and arrow functions work in a similar manner, yet there are certain interesting differences between them. By using function a developer can easily create a block of codes. JavaScript also provides us with the facility to create functions. Due to the ES5 and ES6 standard of JavaScript, functions are also described in a different syntax. ES6 has introduced a new arrow based syntax to write a function which is also called fat arrow function. Let’s find the difference between the regular function and fat arrow function. Basic Syntax of regular vs arrow function Without using any parameter: /***** ES5 Regular Function *****/ let prtLangReg = function ( ) { console . log ( "JavaScript" ) ; } prtLangReg ( ) ; /***** ES6 Arrow Function *****/ let prtLangArrow = _ => { co