Generates an array (list) of a specific length
Aliases:
std::vector<type> listName( size, initialValue );
var myList = Enumerable.Range(0, length).Select(i => 'item' + i.ToString()).ToList();
var myList = List.generate(length, (index) => 'item' + index.toString());
var arrayName = []arrayType{ value1, value2}
[start..end]
List<Type> myList = IntStream.range(0, length).mapToObj(i -> value).collect(Collectors.toList());
const myList = Array.from({ length: length }, (_, index) => 'item' + index);
val myList = List(length) { 'item' + it}
my @listName = (initialValue) x length;
myArray = range(0, 10);
1..length | ForEach-Object { 'item' +_ }
my_array = Array.new(length) { |i| 'item' + i.to_s }
let myList = [ 'item1', 'item2', // Add more items here];
# Bash doesn't have built-in list generation, but you can use loops or command substitution:myList=((for i in {1..10}; do echo itei; done) )
var myArray = Array(repeating: 'item', count: 5);