> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# newlclosure

> Returns a Luau closure that calls the provided function. The first argument must be a function.

<div className="real-function-page">
  ```lua theme={null}
  newlclosure(func: function, debugName?: string): function
  ```

  ## Argumenty

  <ParamField path={"func"} type={"function"} required>
    Function called by the returned Luau closure.
  </ParamField>

  <ParamField path={"debugName"} type={"string"}>
    Optional debug name for the generated closure.
  </ParamField>

  ## Zwroty

  <ResponseField name={"closure"} type={"function"}>
    Generated Luau closure that executes return the original function(..) and forwards arguments to the original function.
  </ResponseField>

  ## Przykład

  Create a Luau closure that calls the original function.

  ```lua theme={null}
  local function add(a, b)
      return a + b
  end

  local wrapped = newlclosure(add, "add")

  print(wrapped(2, 3))
  print(islclosure(wrapped))
  ```
</div>
