Last active
July 19, 2019 19:32
-
-
Save filipesperandio/897e562ae38c53ac2543c280767fb974 to your computer and use it in GitHub Desktop.
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
function joinEndWith(arr, separator, last) { | |
const reg = new RegExp(`(.+)${separator}(.+)`) | |
return arr.join(separator).replace(reg, `$1${last}$2`) | |
} |
Author
filipesperandio
commented
Jul 19, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment