interleave¶
Under Construction
This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/phet-core/blob/main/js/interleave.ts for the most up-to-date information.
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.