searchString, both of which are bound to page variables with the same keys. These values are then available under
inputsobject remains as the "snapshot" taken at the beginning of execution.
filteredEmployeesoutput schema is provided just an array of objects for brevity. In reality, we should explicitly define what properties the objects in the array are expected to have, e.g.
lastNameand so on.)
inputs.searchStringin the code above.
filterfunction on the
inputs.rawEmployeesarray, checking if our search string matches either the first name or last name of the employee.
returnstatement. What we return should always be an object whose properties match what we've defined for our output arguments.
filteredEmployeesproperty contains the filtered data.
indexis the index number of the desired output (starting from
returnObjectis an object whose properties match the output arguments defined for the given output.
momentare currently exposed in the runtime context.
asyncfunction, so you can use the
awaitkeyword on the root level directly. Below is an example where we also implement error handling with