Today let's discuss about the following array functions in Javascript which most of the developers use it for ease of use Map function actually reads thru the entire array and we can perform any operation on each array item The output here would be Filter function as the name suggests we can add any condition and will return only values returning true The output here would be Reduce function it is used for accumulating values in a array by doing some kind of arithmetical operation to each item in array. In the following example we are using addition as an example The output here would be
Today we will learn about the de structuring in java script. Let us take a simple example how a regular array is defined var capital =["Delhi","London","Paris"] now if we want to access London then we have to pass the value as capital[1]. Now an alternate way and when we want to remember the names rather than indexes to query an array is var [India,England,France] = ["Delhi","London","Paris"] In here in order to access London we can say console.log(England) and the output would be London This is a simple way to de structure an array. Similarly we can do the same the for an object as well const myfav = { fruit : "apple" , color : "red" }; console . log (myfav); If we have multiple values in an object const myfav = [ { fruit : "apple" , color : "red" }, { fruit : "mango" , color : "yellow" } ]; Now if we have to get mango details then it shou