---
title: isFunction
nav:
  title: Tools
  path: /tools
group:
  title: Types
toc: content
---

## isFunction

Demo:

```tsx
/**
 * title: 基础用法
 * description: 判断是否为 Function 类型函数
 */

import React from 'react';
import { isFunction } from 'aim-tools';

const result1 = isFunction([1, 2]);
const result2 = isFunction(function() {});

export default () => (
  <pre>
    <code>
      isFunction([1, 2]); // {result1.toString()}
      <br />
      <br />
      isFunction(function() {}); // {result2.toString()}
    </code>
  </pre>
);
```

### API

```typescript
isFunction(fun: any);
```

### Params

| 参数 | 说明           | 类型 | 默认值 | 必填 |
| :--- | :------------- | :--- | :----- | :--- |
| fun  | 需要判断的数据 | any  | -      | 是   |

### Returns

| 返回值 | 说明                         |
| :----- | :--------------------------- |
| true   | 该数据是 Function 类型数据   |
| false  | 该数据不是 Function 类型数据 |
