=proto int duk_put_prop_index(duk_context *ctx, int obj_index, unsigned int arr_index); =stack [ ... obj! ... val! ] -> [ ... obj! ... ] =summary

Like duk_put_prop(), but the property name is given as an unsigned integer arr_index. This is especially useful for writing to array elements (but is not limited to that).

Conceptually the number is coerced to a string for the property write, e.g. 123 would be equivalent to a property name "123". Duktape avoids an explicit coercion whenever possible.

=example duk_push_string(ctx, "value"); rc = duk_put_prop_index(ctx, -3, 123); /* write to obj[123] */ printf("rc=%d\n", rc); =tags property