i hate moving code
it's so tedious having to delete the code and paste it into another file and update the github on both steps
This commit is contained in:
parent
514af575a5
commit
3f42b3eab8
|
|
@ -108,6 +108,19 @@
|
||||||
return tempArray;
|
return tempArray;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function tryJoin(stringOrArray,joiner) {
|
||||||
|
//console.log(`tryJoin: ${stringOrArray}`);
|
||||||
|
if(typeof(stringOrArray) === "string") {
|
||||||
|
//console.log("tryJoin: String");
|
||||||
|
return stringOrArray;
|
||||||
|
} else if(Array.isArray(stringOrArray)) {
|
||||||
|
//console.log("tryJoin: Array");
|
||||||
|
return stringOrArray.join(joiner);
|
||||||
|
} else {
|
||||||
|
throw new TypeError(`Unexpected type: ${typeof(stringOrArray)}`);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
//Checks
|
//Checks
|
||||||
|
|
||||||
//Element exists in the elements object
|
//Element exists in the elements object
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue