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.
19 lines
455 B
19 lines
455 B
=proto
|
|
void duk_remove(duk_context *ctx, int index);
|
|
|
|
=stack
|
|
[ ... val(index)! ... ] -> [ ... ... ]
|
|
|
|
=summary
|
|
<p>Remove value at <tt>index</tt>. Elements above <tt>index</tt>
|
|
are shifted down the stack by a step. If <tt>to_index</tt> 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_remove(ctx, -2); /* -> [ 123 345 ] */
|
|
|
|
=tags
|
|
stack
|
|
|