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

name: duk_set_length
proto: |
void duk_set_length(duk_context *ctx, duk_idx_t idx, duk_size_t len);
stack: |
[ ... val! ... ]
summary: |
<p>Set "length" for value at <code>idx</code>. Equivalent to the ECMAScript
statement <code>obj.length = len;</code>.</p>
example: |
/* Set array length to zero, deleting elements as a side effect. */
duk_set_length(ctx, -3, 0);
tags:
- stack
seealso:
- duk_get_length
introduced: 2.0.0