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

# islclosure

Tells you whether a function was written in Luau.

```luau theme={null}
islclosure(func: function): boolean
```

Most commonly used to find user-script functions and look inside them.<br />For example, `getconstants` only works on Luau closures:

```luau theme={null}
for _, fn in ipairs(getgc()) do
    if type(fn) == "function" then
        if islclosure(fn) then
            -- it's a LocalScript's/ModuleScript's Luau function!
            for i, k in ipairs(getconstants(fn)) do
                print(`constant {i}: {tostring(k)}`)
            end
        else
            -- it's an internal roblox's engine C function, pass
        end
    end
end
```

## Parameters

| Parameter | Type       | Description            |
| --------- | ---------- | ---------------------- |
| `func`    | `function` | The function to check. |

## Returns

`true` if `func` is a Luau closure, `false` if it's a C closure.

## Example

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  local isL = islclosure(print)
  =======
  -- islclosure(func: function): boolean
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  for _, fn in ipairs(getgc()) do
      if type(fn) == "function" then
          if islclosure(fn) then
              -- it's a LocalScript's/ModuleScript's Luau function!
              for i, k in ipairs(getconstants(fn)) do
                  print(`constant {i}: {tostring(k)}`)
              end
          else
              -- it's an internal roblox's engine C function, pass
          end
      end
  end
  ```
</CodeGroup>

<Tip>
  Lua closures are user-defined or script-defined Luau functions.
</Tip>
