fill

Fills a list with a given value.

This function generates a change (except when called on a variable).

Function

list.fill(item)

Return value

Returns the filled list.

Example

This code creates a list with five nil values

range(5).fill(nil);

Return value in JSON format

[null, null, null, null, null]