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
382 B

=proto
void duk_swap(duk_context *ctx, int index1, int index2);
=stack
[ ... val1! ... val2! ... ] -> [ ... val2! ... val1! ... ]
=summary
<p>Swap values at indices <code>index1</code> and <code>index2</code>. If the
indices are the same, the call is a no-op. If either index is invalid,
throws an error.</p>
=tags
stack
=example
duk_swap(ctx, -5, -1);
=seealso
duk_swap_top