name: duk_to_string proto: | const char *duk_to_string(duk_context *ctx, duk_idx_t index); stack: | [ ... val! ... ] -> [ ... ToString(val)! ... ] summary: |

Replace the value at index with an Ecmascript ToString() coerced value. Returns a non-NULL pointer to the read-only, NUL-terminated string data. If index is invalid, throws an error.

example: | printf("coerced string: %s\n", duk_to_string(ctx, -3)); tags: - stack - string seealso: - duk_safe_to_string introduced: 1.0.0