DEV Community

Discussion on: 8 JavaScript Tips & Tricks That No One Teaches 🚀

mliakos profile image
Emmanouil Liakos

Another nice tip is that arrays passed to template literals get coerced to comma-separated strings like this:

const fruits = ['apples', 'oranges'];
console.log(${fruits}); // 'apples,oranges'

Some comments have been hidden by the post's author - find out more