Created
November 9, 2018 13:27
-
-
Save a-x-/f44e803fe750148e055f44cb6fb1c248 to your computer and use it in GitHub Desktop.
interpose like join, but returns an array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# like join, but returns an array | |
interpose = (array, glue) -> | |
array.reduce (res,x) -> [].concat res, glue, x | |
export default interpose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment