Skip to content

Instantly share code, notes, and snippets.

@amyhenning
Last active September 1, 2018 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amyhenning/a96431affc31b590095a82b7af9b2b80 to your computer and use it in GitHub Desktop.
Save amyhenning/a96431affc31b590095a82b7af9b2b80 to your computer and use it in GitHub Desktop.
Built the join method using JavaScript
"use strict";
var _ = {
join: (array, separator = ',') => {
var newString = array.toString();
if (separator) {
var replaced = newString.replace(",", separator);
}
console.log(replaced);
}
}
const value = _.join(["hello", "goodbye"], "...")
console.log(value);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment