Posts

Showing posts from May, 2020

Understanding Memoization And Dynamic Programming in Javascript

Image
Understanding Memoization And Dynamic Programming in Javascript Memoization is a big complicated word that you may have never even heard before, but you may be surprised to know that you are most likely already using memoization without even realizing it. Memoization is just the act of caching values so that they can be calculated quicker in the future. Memoization is really useful in all parts of programming, but where it is most useful is in dynamic programming. In this video I will explain what memoization is, how to use it, and why it is so useful especially in dynamic programming. 🧠 Concepts Covered: What memoization is When you should use memoization How to use memoization What dynamic programming is How to use memoization in dynamic programming

JavaScript Class # OOPS JS

Image
JavaScript ES6 Classes An exciting new construct that was introduced in the ES6 specification is the ES6 classes. If you're a Javascript developer, you will be aware that Javascript follows prototypal inheritance and sometimes it can get a little messy. However, with ES6 classes the syntax is simpler and much more intuitive. Classes are a fundamental part of object oriented programming (OOP). They define “blueprints” for real-world object modeling and organize code into logical, reusable parts. Classes share many similarities with regular objects. They have their own constructor functions, properties, and methods. In this tutorial, we’ll demonstrate how to create and work with ES6 classes. Creating a class You can create a class using the class keyword: class Patient{ constructor(name, age) { this.name = name this.age = age } } let pat = new Patient("RK", 34) pat.name //returns 'RK' pat.age //returns 34 Notice how we de