[Home](./index.md) > [puppeteer](./puppeteer.md) > [Frame](./puppeteer.frame.md) > [waitForFunction](./puppeteer.frame.waitforfunction.md)
## Frame.waitForFunction() method
Signature:
```typescript
waitForFunction(pageFunction: Function | string, options?: {
polling?: string | number;
timeout?: number;
}, ...args: unknown[]): Promise;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| pageFunction | Function \| string | |
| options | { polling?: string \| number; timeout?: number; } | |
| args | unknown\[\] | |
Returns:
Promise<[JSHandle](./puppeteer.jshandle.md)>