name: duk_require_function proto: | void duk_require_function(duk_context *ctx, duk_idx_t idx); stack: | [ ... val! ... ] summary: |

Throw an error if the value at idx is not a function or if the index is invalid.

There is no "get" primitive (duk_get_function()) because there's no useful C return value for an arbitrary function.
example: | duk_require_function(ctx, -3); tags: - stack introduced: 1.4.0