nerdexam
ServiceNow

CAD · Question #204

Here is the Business Rule script template: This type of JavaScript function is known as:

The correct answer is D. Self-invoking. The standard Business Rule script template wraps the logic in a self-invoking function (also called an Immediately Invoked Function Expression, or IIFE). The pattern looks like: (function executeRule(current, previous) { / logic here / })(current, previous); - the function is…

Submitted by kim_seoul· Apr 18, 2026Application Automation

Question

Here is the Business Rule script template:

This type of JavaScript function is known as:

Options

  • AConstructor
  • BScoped
  • CAnonymous
  • DSelf-invoking

How the community answered

(29 responses)
  • A
    7% (2)
  • B
    3% (1)
  • D
    90% (26)

Explanation

The standard Business Rule script template wraps the logic in a self-invoking function (also called an Immediately Invoked Function Expression, or IIFE). The pattern looks like: (function executeRule(current, previous) { /* logic here */ })(current, previous); - the function is defined and immediately called in the same expression, passing 'current' and 'previous' as arguments. This is 'self-invoking' because it invokes itself at the point of definition, without needing an explicit external function call.

Topics

#JavaScript#Functions#Business Rules#Server-side Scripting

Community Discussion

No community discussion yet for this question.

Full CAD Practice