- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
11-21-2021 06:38 AM - edited 11-10-2022 06:56 AM
Hi All,
Hope you all are doing fine.
In today's tutorial, we will look into one important higher-order function in JavaScript which will help you a lot with scripting in ServiceNow.
Let's first understand what is Higher-order function in JavaScript is.
Higher-order function:
In JavaScript, functions can be assigned to variables in the same way that strings or arrays can. They can be pasted into other functions as parameters or returned from them as well.
A “higher-order function” is a function that accepts functions as parameters and/or returns a function.
Let's now understand the function map in Javascript: The .map() method executes a callback function on each element in an array. It returns a new array made up of the return values from the callback function.
The original array does not get altered, and the returned array may contain different elements than the original array.
Please be sure to bookmark this article as well as mark it as Helpful if you thought it was helpful.
Regards,
Amit Gujarathi
- 702 Views
