Amit Gujarathi
Giga Sage
Giga Sage

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)

Comments
Mwatkins
ServiceNow Employee
ServiceNow Employee

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 

[Dev site] GlideQuery API

Please 👍 if Helpful

"Simplicity does not precede complexity, but follows it"

Sagar patil
Tera Explorer
Can we have other JavaScript articles also
Version history
Last update:
‎10-11-2022 02:37 AM
Updated by:
Contributors