- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
11-15-2021 01:35 AM - edited 10-11-2022 02:37 AM
Hi All ,
In this Article, we will look into Functional programming use in ServiceNow i.e. How we can use JavaScript functional programming in ServiceNow. In this video, we will look into the JavaScript Filter method and how we can use in ServiceNow.
So let's first understand what is a higher-order function is in javascript is.
Higher-Order Functions
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
Array Method .filter() The .filter() method executes a callback function on each element in an array. The callback function for each of the elements must return either true or false. The returned array is a new array with any elements for which the callback function returns true.
Please like, follow subscribe to my channel if you find it helpful.
Regards,
Amit Gujarathi
(Technomonk)
- 1,476 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for posting this video! Functional programming has a learning curve - it has been a challenge for me for sure since I'm so used to writing loops over and over. Your video is easy to follow and demonstrates the value of learning functional programming.
Functional programming is also a prerequisite for using the GlideQuery API. GlideQuery is an alternative to GlideRecord; a way of accessing ServiceNow's database via javascript code. It has a number of improved features to encourage higher code quality. Caveat: GlideQuery currently does not support encoded queries.
[Doc Site] GlideQuery - Scoped, Global
Please 👍 if Helpful
"Simplicity does not precede complexity, but follows it"
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content