{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Journeys","product":"Identity Management","type":"markdown"},"seo":{"title":"Expressions: Lamda invocations","description":"Everything about Mosaic Journeys, SDKs, and APIs","siteUrl":"https://developer.transmitsecurity.com/","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"expressions-lamda-invocations","__idx":0},"children":["Expressions: Lamda invocations"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"_","__idx":1},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Lambdas are very much like functions—constructed as described in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/orchestration/getting-started/expressions/constructors#lambda-constructors"},"children":["Lamba Constructors"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The syntax for invoking a lambda is similar to the function invocation syntax:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"js","header":{"controls":{"copy":{}}},"source":"@(lambda)(arg1, ...)\n","lang":"js"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["where ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["lambda"]}," is an expression returning a lambda value, and ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["arg1"]},", ... are comma-separated expressions that calculate arguments to pass to the lambda."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When invoking a lambda, its body expression will be evaluated with the parameters bound to arguments passed at the invocation point. For example, consider the following expression: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["let twice=(x)=>2*x return @(twice)(8)"]},". The lambda invocation expression here, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@(twice)(8)"]},", will invoke the lambda value constructed by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(x)=>2*x"]},"  since this is the value bound to variable twice. This invocation will bind the value 8 to argument x, and then evaluate and return the expression ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2*x"]}," —which will yield 16."]}]},"headings":[{"value":"Expressions: Lamda invocations","id":"expressions-lamda-invocations","depth":1},{"value":"","id":"_","depth":2}],"frontmatter":{"showNextButton":true,"showPrevButton":true,"seo":{"title":"Expressions: Lamda invocations"}},"lastModified":"2025-11-18T16:48:04.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/orchestration/getting-started/expressions/lamda","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}