JS Learnings

Promise in real world

What is a promise A promise represents the eventual result of an asynchronous operation  A promise is an object that is used as a placeholder for the eventual result of a deferred and possibly asynchronous computation. A promise can be created as var myPromise = new Promise(function(resolve,reject){ }); From above, […]

JS Learnings – 2

Simple JavaScript function. Functions with additional or missing arguments Making the add function smarter In the previous example, when the function receives less than three parameters, then it would return NaN. This example fixes that by checking if the incoming parameter is undefined or null and then substituting that with […]

JS Learnings – 1

JavaScript is dynamically typed. This unassumingly simple feature is one of the most powerful strengths of the language. As your experience with the language evolves you will appreciate the less ceremony involved in creating variables   JavaScript has types that are not common in other languages. Type such as “undefined” […]