Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
- JS
- JS
- Ruby
- Python
- Python
- Go
- Elixir
- Pascal
- Clojure
- C++
- C++
- C#
- C#
- D
- Dart
- Erlang
- Fortran
- Groovy
- Haskell
- Java
- Java
- Java
- Java
- Kotlin
- Lisp
- Lua
- Obj-C
- PHP
- Perl
- Rust
- Scala
- Scheme
- Smalltalk
- VB
const items = [a, b, c];
const items = new Array(a, b, c);
This works fine, but read the doc carefully!
items = [a, b, c]
items = list((a, b, c))
items = [a, b, c]
items := []T{a, b, c}
This creates a slice of type T.
(def items (list a b c))
list items { a, b, c };
For most uses, you actually want vector<> rather than list<>.
auto items = [a, b, c];
Assuming that a, b and c have the same type, the list type is infered.
var items = [a, b, c];
Items = [A,B,C].
integer, dimension(3) :: items
items = [a,b,c]
def items = [a, b, c]
a, b and c may have different types.
items = [a, b, c]
List<T> items = new ArrayList<>(of(a, b, c));
Mutable
(defparameter *items* (list a b c))
NSArray *items=@[a,b,c];
my @items = ($a, $b, $c);
val items = List(a, b, c)
(define items (list a b c))
items := {a . b . c}.
Dim salmons As New List(Of String) From
{"chinook", "coho", "pink", "sockeye"}
Create a list of strings by using a
collection initializer.
collection initializer.