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.
26 lines
563 B
26 lines
563 B
name: duk_pull
|
|
|
|
proto: |
|
|
void duk_pull(duk_context *ctx, duk_idx_t from_idx);
|
|
|
|
stack: |
|
|
[ ... val! ... ] -> [ ... ... val! ]
|
|
|
|
summary: |
|
|
<p>Remove value at <code>from_idx</code> and push it on the value stack top.</p>
|
|
If <code>from_idx</code> is an invalid index, throws an error.</p>
|
|
|
|
example: |
|
|
duk_push_int(ctx, 123);
|
|
duk_push_int(ctx, 234);
|
|
duk_push_int(ctx, 345); /* -> [ 123 234 345 ] */
|
|
duk_pull(ctx, -2); /* [ 123 234 345 ] -> [ 123 345 234 ] */
|
|
|
|
tags:
|
|
- stack
|
|
|
|
seealso:
|
|
- duk_insert
|
|
- duk_remove
|
|
|
|
introduced: 2.5.0
|
|
|