JavaScript programming language Array Methods One Must Know

Webner Solutions
3 min readMay 4, 2021

--

JavaScript programming language Array Methods One Must Know
JavaScript programming language Array Methods One Must Know
  1. The filter is an array function in vanilla.js which returns a new array by filtering the filter item provided to the filter function.
  2. Here is ES6 syntax for this function:
  • Reduce
  1. This function basically executes a given function provided to it. It is used to add/multiply/divide/subtract and also provide an imploded string of given values inside the array.
  2. Here is ES6 syntax for this function:
  • forEach:
  1. This function is used to iterate through each element of the array similar to for loop. Basically used to write or list all items of it.
    Here is ES6 syntax for this function:
  • Every and some
  1. These two functions are quite similar to each other but have one major difference: every function performs a given test and every element needs to pass that test whereas, in some functions, at least one element needs to pass the test. These functions return boolean value as a response.
  2. Here is ES6 syntax for this function:
  • Includes
  1. The purpose of this function is used to find a value that exists or not exists in an array. It returns a boolean value.
  2. Here is ES6 syntax for this function:
  • Map
  1. Last but not least, the map function returns a new array by performing a particular function on each and every element of it.
    Here is ES6 syntax for this function:

— 😉 HAPPY CODING 😉 —

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Originally published at https://blog.webnersolutions.com on May 4, 2021.

--

--

Webner Solutions
Webner Solutions

Written by Webner Solutions

Our team in Salesforce is very strong, with in-depth knowledge of Salesforce classic and Lightning development as well as the Service cloud.

No responses yet