Version: v0.5.0 - Beta.  We welcome contributors & feedback.  THanks!

List.default

default(value)

Description

Set a default value for missing elements.

let nums = [10, 20, 30].default(0);

nums[0]; //= 10
nums[9]; //= 0 (default)