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.
23 lines
492 B
23 lines
492 B
11 years ago
|
=proto
|
||
11 years ago
|
void duk_remove(duk_context *ctx, duk_idx_t index);
|
||
11 years ago
|
|
||
|
=stack
|
||
|
[ ... val(index)! ... ] -> [ ... ... ]
|
||
|
|
||
|
=summary
|
||
11 years ago
|
<p>Remove value at <code>index</code>. Elements above <code>index</code>
|
||
|
are shifted down the stack by a step. If <code>to_index</code> is
|
||
11 years ago
|
an invalid index, throws an error.</p>
|
||
11 years ago
|
|
||
|
=example
|
||
|
duk_push_int(ctx, 123);
|
||
|
duk_push_int(ctx, 234);
|
||
|
duk_push_int(ctx, 345); /* -> [ 123 234 345 ] */
|
||
|
duk_remove(ctx, -2); /* -> [ 123 345 ] */
|
||
11 years ago
|
|
||
|
=tags
|
||
|
stack
|
||
10 years ago
|
|
||
|
=introduced
|
||
|
1.0.0
|