-
Notifications
You must be signed in to change notification settings - Fork 0
ds.initialize
metmajer edited this page Mar 16, 2013
·
3 revisions
initialize(value, [length=1])
Initializes a data series from a particular value
.
Each element in the resulting series will be a clone of value
.
If value
is a function it will be evaluated for each element.
ds.initialize(0, 3);
// => [0, 0, 0]
ds.initialize("a", 3);
// => ["a", "a", "a"]
ds.initialize([1, 2, 3], 3);
// => [[1, 2, 3], [1, 2, 3], [1, 2, 3]]
-
* value The initialization value.
-
Number [length=1] The length of the resulting series (defaults to 1).
- Array Returns the initialized data series.
-
Error Throws if
length
is defined and is not an integer > 0.