Let say you have a for loop and you want to build a string in a very specific way using template literals
I've find 2 similar ways to do it.
let text = ''
words = ['Hello', 'world']
for (i = 0; i < n; i++) {
text += `${words[i]} || `
}
Or
let text = ''
words = ['Hello', 'world']
for (i = 0; i < n; i++) {
text = `${text}${words[i]} || `
}
Both produce the same output (Hello || world || )
Is any difference in performance or standard?
['Hello', 'world'].concat('').join(" || ")
as a task to measure performance.