What I want is something like Array.join(separator), but which takes a second argument Array.join(separator, beforeLastElement), so when I say [f
Array.join(separator)
Array.join(separator, beforeLastElement)
[f
function getValuesfromArray(strArray) { let endString = ""; if (strArray.length > 1) { const lastEntry = strArray.pop(); endString = strArray.join(", ") + " or " + lastEntry; } else { endString = strArray.toString(); } return endString; }