Traceur ES6 Promise Object
ES6 provides Promise object to support deferred and asynchronous execution of JavaScript. The Promise object helps in resolving Blocking nature of JavaScript. In this demo, “We will learn to use promise object in a JavaScript code”. The following code contains a method squarePositiveNumber() takes a number as input and returns a promise object.The Promise object […]
Traceur ES6 Template Feature
ES6 provides template string to render JavaScript expression.Template strings are string literals allowing embedded expressions. Template strings are enclosed by the back-tick ``. The expressions are included with dollar sign and curly braces as ${}. In this demo, “We will learn to use ES6 template string”. The following code contains a student detail object aStudent […]
Lodash Flow Function
Lodash provides flow function which helps in sequencing multiple functions in series. Lodash _.flow() method takes the function names as parameters and executes in sequence by binding to current scope. In this demo, “We will learn how to use lodash flow functions”. The following code shows 4 methods substractByOne(), addByTwo(),multiplyByThree() and divideByFour(). Lodash _.flow() method […]
Lodash Curried Function
Lodash supports the creation of curried function by using _.curry() method. A normal function when called with appropriate number of parameters it runs to the end of the execution. Sometime while programming we face situation when we don’t have sufficient number of parameters to call a function.I mean think of a situation when a method […]