Skip to content

cotrVarList

Creates a list variable

Aliases:

  • cotrVarList
  • createList
  • listVariable
  • arrayVariable
  • variableList
  • variableArray
  • list
  • array

cpp

std::vector<type> myList = {values};

csharp

List<Type> myList = new List<Type>();

dart

List<Type> myList = [items];

go

var variableName = []variableType{
value1,
value2
}

haskell

let myList = [items]

java

List<Type> myList = new ArrayList<>();
myList.add(value);

javascript

let myList = ['item1', 'item2'];

javascriptreact

let myList = ['item1', 'item2'];

kotlin

var myList = listOf('item1', 'item2')

perl

my @myArray = (items);

php

myArray = [items];

powershell

Terminal window
myArray = @(items)

python

myList = [1, 2, 3]

r

my_array <- c(items)

ruby

my_array = [
'item1',
'item2',
# Add more items here
]

rust

let myList = [
'item1',
'item2',
// Add more items here
];

scala

val myList = List(items)

shellscript

Terminal window
# Create an array (list):
myList=( item1 item2 item3 )

swift

var myArray = ['item1', 'item2', 'item3'];

typescript

let myList: type[] = ['item1', 'item2'];

typescriptreact

let myList: type[] = [
'item1',
'item2',
// Add more items here
];