I recently found out, through code golf, about a new way of calling a function that takes a string as a paremeters. It basically goes like this :
console.log('some strings'.split``)
For some reason, we don't need the parentheses for this code to be valid.
This imply that you could also create custom function that takes a string as a parameter
function appendSomething(string) {
return string + " something else";
}
console.log(appendSomething`some thing`);
I was wondering about the use cases of such feature. Aside from code golfing or maybe minifying code, I don't see any good use case and find this synthax rather confusing. Why would you use this ?