Created
May 27, 2018 18:47
-
-
Save cefaijustin/592f0cf091100bcf506d4c9d859be3a5 to your computer and use it in GitHub Desktop.
Ta daa.
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
"use strict"; | |
var _ = { | |
join: (array, separator = ",") => { | |
var str = ""; | |
for (var i = 0; i < array.length; i++) { | |
str += separator + array[i]; | |
} | |
return str.substring(2); | |
} | |
} | |
const value = _.join(["hello", "goodbye"], " , ") | |
console.log(value); | |
const value2 = _.join(["dogs", "cats", "birds"], " + ") | |
console.log(value2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment