---
name: "JavaScript::QuickJS::Function"
section: "3pm"
platform: "linux"
package: "libjavascript-quickjs-perl"
version: "0.21-2+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/JavaScript::QuickJS::Function"
---

# JavaScript::QuickJS::Function(3pm)

JavaScript \`Function\` in Perl

## NAME

JavaScript::QuickJS::Function - JavaScript \`Function\` in Perl

## SYNOPSIS

```
    my $func = JavaScript::QuickJS->new()->eval("() => 123");
    print $func->();    # prints “123”; note overloading :)
```

## DESCRIPTION

This class represents a JavaScript Function \<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Function\> instance in Perl.

This class is not instantiated directly.

## OVERLOADING

For convenience, instances of this class are callable as Perl code references. This is equivalent to a `call()` with `$this_sv` (see below) set to undef.

See the "SYNOPSIS" above for an example.

## INVOCATION METHODS

### $ret = *OBJ*-\>call( $this\_sv, @arguments )

Like JavaScript’s method of the same name.

## ACCESSOR METHODS

The following methods return their corresponding JS property:

- •

  `length()`

- •

  `name()`
