I found myself in need of concatenating multiple string arguments with a specific delimiter, so after searching online, I stumbled upon a helpful guide on Mozilla's website that taught me how to achieve this using the arguments
object.
function myConcat(separator) {
var args = Array.prototype.slice.call(arguments, 1);
return args.every(x => x === '') ? '' : args.join(separator);
}
After testing this code on a regular JS compiler like repl.it, it worked flawlessly! It's always satisfying to see something work as intended.
However, when integrating this code into my Angular 6 application, I encountered an error stating that I was passing too many arguments to the function, when it only expects one.
Is there a solution to making this work seamlessly in Angular 6?