Worker in javascript with Example

In JavaScript, a Web Worker is a separate background thread that allows you to perform time-consuming or computationally intensive tasks without blocking the main thread of the web page. This helps to keep the web page responsive and prevents it from becoming unresponsive during resource-intensive operations. To pass data from the main thread to a … Read more

What is Higher-Order Functions in functional programming of javascript ?

Higher-order functions are very useful in asychronous functional programming of javascript, Array.filter, and Array.reduce methods all take functions as arguments. They are higher-order functions. Example Currying is a functional technique that involves the use of higher-order functions. Currying is the practice of holding on to some of the values needed to complete an … Read more

How Data Transformations works in Javascript ?

Functional programming is all about transforming data from one form to another. We will produce transformed copies using functions. These functions make our code less imperative and thus reduce complexity Data Transformations two core functions are Array.reduce join() method in javascript join is a built-in JavaScript array method that we can use to extract … Read more

What is Pure function in javascript ES6 ?

A pure function is a function that returns a value that is computed based on its arguments. Pure functions take at least one argument and always return a value or another function. They do not cause side effects, set global variables, or change anything about application state. They treat their arguments as immutable data Example … Read more

What is Immutability in javascript Functional Concepts ?

. Immutability in functional Concepts is how original data is unchangable. but function can change the public data. To understand how immutability works in functional concept, let’s take a look at what it means to mutate data Example in the above example color object is immutable in functional concepts e.g rating has been changed in … Read more

What is Module in javascript ES6 ?

Module in javascript is a piece of reusable code that can easily be use intoother JavaScript files JavaScript modules are stored in separate files, one file per module. There are twooptions when creating and exporting a module: you can export multiple JavaScriptobjects from a single module, or one JavaScript object per module Example of ES6 … Read more

What is Promises in javascript ?

Promises in javascript is used to handle the asynchronus task. Promises in javascript has producing code and consuming code to handle. it means consuming code has to be wait until code can not be produce either with sucess or with error Promises method is used to handle the promises Syantax : new Promise(sucessmethod,errormethod) Promise object … Read more

What is The Spread Operator in javascript ES6 ?

Spread Operator in ES6 is three dot(…) to make a copy of array without alter or muted the original array Example var array1 = [“Tallac”, “Ralston”, “Rose”]var array2 = [“Ward”, “Blackwood”]var array3 = […array1, …array2]console.log(array3.join(‘, ‘)) // Tallac, Ralston, Rose, Ward, Blackwood Without the Spead Operator(…) the reverse() method to get the last element from … Read more

What is Destructuring Assignment in javascript ES6 ?

The destructuring assignment in ES6 allows us to locally scope fields within an object andto declare which values will be used. Example: in the above example the code pulls bread and meat out of the object and creates local variables for them. Destructuring Assignment does not alter the value of Object Example destructure for incoming … Read more

What is Template Strings in javascript ES6 ?

Template Strings in ES6 provide us with an alternative to string concatenation. They alsoallow us to insert variables into a string. that’s make quite easy for String Concatenation in ES6 But with a Template Strings, we can create one string and insert the variable values by surrounding them with ${ }: Example of Traditional Strings … Read more