Skip to main content

Vector.fill

Vector.filllengthitem

Group: Constants
Aliases: repeat

Documentation

Creates a new vector of the given length, filling the elements with the provided constant.

A vector allows to store an arbitrary number of elements in linear memory. It is the recommended data structure for most applications.

Arguments

  • length: The length of the vector (>= 0).
  • item: A value to be placed into each element of the vector.

Examples

Create a vector containing 50 elements, each being the number 42.

      Vector.fill length=50 item=42