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

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