Created
August 3, 2018 18:53
-
-
Save nullthoughts/f2673b575de7fb5ec7d65e39158c139f to your computer and use it in GitHub Desktop.
Vue Implode Method (Join on Array Key)
This file contains hidden or 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
implode(array, key = null, glue = ', ') { | |
if(key) { | |
array = array.map(function(element) { | |
return element[key]; | |
}) | |
} | |
return array.join(glue); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment