Javascript


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” […]


Functional programming concepts in Javascript & Java – 1 4

In this post, we will cover What is functional programming? Higher order function An example of higher order function   The concept of functional programming is based on lambda calculus (early 1930). It took nearly 20 years for the first functional programming language to evolve; Lisp (founded in 1958; paper published […]