Skip to content
Snippets Groups Projects
Commit fd98fa61 authored by lowercasedonkey's avatar lowercasedonkey
Browse files

fruit spelling

parent 1f30607d
No related branches found
No related tags found
1 merge request!8544move content into AssaySlave
...@@ -50,8 +50,8 @@ jQuery(document).trigger("categorizer.ready"); ...@@ -50,8 +50,8 @@ jQuery(document).trigger("categorizer.ready");
/** /**
* Converts an array of strings into a sentence parted by commas. * Converts an array of strings into a sentence parted by commas.
* @param {Array} array ["apple", "bannana", "carrot"] * @param {Array} array ["apple", "banana", "carrot"]
* @returns {string} "apple, bannana and carrot" * @returns {string} "apple, banana and carrot"
*/ */
globalThis.arrayToSentence = function(array) { globalThis.arrayToSentence = function(array) {
return array.reduce((res, ch, i, arr) => res + (i === arr.length - 1 ? ' and ' : ', ') + ch); return array.reduce((res, ch, i, arr) => res + (i === arr.length - 1 ? ' and ' : ', ') + ch);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment