Vector: Difference between revisions

Jump to navigation Jump to search
197 bytes added ,  16 June 2021
no edit summary
(Describe how to call functions of objects stored in a vector)
No edit summary
Line 92: Line 92:
var result = v.size();
var result = v.size();
assert(result == 3);
assert(result == 3);
</syntaxhighlight>
To query the value at a specific index, use vector():
<syntaxhighlight lang="nasal">
var v = std.Vector.new(['a', 'b', 'c']);
var result = v.vector(1);
assert(result == "b");
</syntaxhighlight>
</syntaxhighlight>


1,414

edits

Navigation menu