---
name: "JavaScript::Function"
section: "3pm"
platform: "linux"
package: "libjavascript-perl"
version: "1.16-3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/JavaScript::Function"
---

# JavaScript::Function(3pm)

Reference to a JavaScript function

## NAME

JavaScript::Function - Reference to a JavaScript function

## DESCRIPTION

Functions in JavaScript are actually `"Function"`-objects. This class encapsulates them and make them invokeable as a code-reference from Perl.

## INTERFACE

### INSTANCE METHODS

- as\_function

  Returns an code-reference that can be invoked which calls the underlying JavaScript `"Function"`-object.

### OVERLOADED METHODS

Instances of this class overloads `"&{}"` which means that you can use the instance as a code-reference directlly without having to use `"as_function"`.
