interleave¶
Overview¶
Returns a copy of an array, with generated elements interleaved (inserted in-between) every element. For example, if you call interleave( [ a, b, c ], Math.random )
, it will result in the equivalent: [ a, Math.random(), b, Math.random(), c ]
.
@author Jonathan Olson <jonathan.olson@colorado.edu>
Source Code¶
See the source for interleave.ts in the phet-core repository.