Skip to content
Will Blanton edited this page Jul 6, 2018 · 6 revisions

Added functionality for Arrays!

This is an Extension! Learn about using Extensions here!

strings_to_ints():Array

Converts an array of strings to an array of itegers

contains():Bool

Checks whether or not an array contains a value or object

get_random():Dynamic

Returns a random element from an array

shuffle():Array

shuffles an array in place and returns it

merge(a2:Array):Array

Merges a second array (of the same type) into the first array

Examples

["0", "1", "2", "3"].strings_to_ints(); // [0, 1, 2, 3]
["apple", "orange", "banana"].contains("apple"); // true
[0, 1, 2, 3].get_random(); // 2
[0, 1, 2, 3].shuffle(); // [2, 1, 3, 0]
[0, 1].merge([2, 3]); // [0, 1, 2, 3]
Clone this wiki locally