mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
440 B
20 lines
440 B
=proto
|
|
void duk_dup(duk_context *ctx, int from_index);
|
|
|
|
=stack
|
|
[ ... val! ... ] -> [ ... val! ... val! ]
|
|
|
|
=summary
|
|
<p>Push a duplicate of value at <code>from_index</code> to the stack.
|
|
If <code>from_index</code> is invalid, throws an error.</p>
|
|
|
|
=example
|
|
duk_push_int(ctx, 123); /* -> [ ... 123 ] */
|
|
duk_push_int(ctx, 234); /* -> [ ... 123 234 ] */
|
|
duk_dup(ctx, -2); /* -> [ ... 123 234 123 ] */
|
|
|
|
=tags
|
|
stack
|
|
|
|
=seealso
|
|
duk_dup_top
|
|
|