name: duk_get_string_default proto: | const char *duk_get_string_default(duk_context *ctx, duk_idx_t idx, const char *def_value); stack: | [ ... val! ... ] summary: |

Like duk_get_string() but with an explicit default value, returned when the value is not a string or the index is invalid.

example: | const char *host = duk_get_string_default(ctx, 3, "localhost"); tags: - stack - string seealso: - duk_get_lstring_default introduced: 2.1.0