constant (constant value)
constant(val: Number|Boolean) -> Array<Number>|Array<Boolean>Creates an array of the same length as the number of klines, with all elements set to the input value.
Note
Most functions also accept simple Number / Boolean parameters in place of an array, so this function is not needed in most cases. If you’re looking at constructing a new array from scratch, e.g. via a for-loop, see num_array and bool_array