Create a vector

vector  list (array)

Create a new immutable vector from args. Out of range indexes return nil.

Introduced in v2.6

Examples

# Example 1

(vector 1, 2, 3)[0]



#=> 1



# Example 2

(vector 1, 2, 3)[1]



#=> 2



# Example 3

(vector 1, 2, 3)[2]



#=> 3



# Example 4

(vector 1, 2, 3)[3]



#=> nil



# Example 5

(vector 1, 2, 3)[1000]



#=> nil



# Example 6

(vector 1, 2, 3)[-1]



#=> nil



# Example 7

(vector 1, 2, 3)[-1000]



#=> nil