JSValue obj = duk_get_global_string(ctx, "myObject"); double num = duk_get_number(ctx, -1);
JSValue obj = duk_get_global_string(ctx, "myObject"); const char* str = duk_get_string(ctx, -1);
JSValue arr = duk_get_global_string(ctx, "myArray"); JSValue elem = duk_get_prop_index(ctx, -1, 0);In this example, we get a global JS array called "myArray" and then extract an element value at index 0 using the JSValue get function "duk_get_prop_index()". The resulting value is stored in a JSValue variable named "elem". Package/library: Duktape