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

Like duk_get_int(), but throws an error if the value at idx is not a number or if the index is invalid.

example: | printf("int value: %ld\n", (long) duk_require_int(ctx, -3)); tags: - stack introduced: 1.0.0