> ## 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.

# hasmetatable

> Returns whether the target value has a metatable. The function returns one boolean and does not return or change the metatable itself.

<div className="real-function-page">
  ```lua theme={null}
  hasmetatable(target: any): boolean
  ```

  ## Аргументы

  <ParamField path={"target"} type={"any"} required>
    Value to check for a metatable.
  </ParamField>

  ## Возвраты

  <ResponseField name={"hasMetatable"} type={"boolean"}>
    true when the target has a metatable; otherwise false.
  </ResponseField>

  ## Пример

  Check whether a value currently has a metatable.

  ```lua theme={null}
  local target = {}

  print(hasmetatable(target))

  setrawmetatable(target, {})

  print(hasmetatable(target))
  ```
</div>
