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.
24 lines
510 B
24 lines
510 B
name: duk_dup
|
|
|
|
proto: |
|
|
void duk_dup(duk_context *ctx, duk_idx_t 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
|
|
|
|
introduced: 1.0.0
|
|
|