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.
 
 
 
 
 
 

20 lines
436 B

name: duk_swap_top
proto: |
void duk_swap_top(duk_context *ctx, duk_idx_t idx);
stack: |
[ ... val1! ... val2! ] -> [ ... val2! ... val1! ]
summary: |
<p>Swap stack top with value at <code>idx</code>. If <code>idx</code> refers
to the stack top, the call is a no-op. If the value stack is empty or
<code>idx</code> is invalid, throws an error.</p>
example: |
duk_swap_top(ctx, -3);
tags:
- stack
introduced: 1.0.0