How can we concatenate 2 or more strings in JavaScript?

Francisco Suarez
Frontend Weekly
Published in
1 min readSep 28, 2019

JavaScript, like any other language, has the ability to concatenate or join 2 or many more strings.

Now how do we achieve this?
It is something as simple as using the +operator, suppose we have a string called nameand a string that is agewhat we will do is show in a console.log()a small text the nameand age.

Alternatively, we can use concat(), which is a method of the String object, this method returns a concatenated string.

In general, it is advisable to use the simplest form, name + age and take into account the spaces when making concatenations

If the article you liked or you found interesting, please help me with 👏 🤓 You can follow me on Twitter or find me on GitHub by visiting my website.

--

--

Francisco Suarez
Frontend Weekly

📚Computer Science Student 🚀 JavaScript Developer 🐱‍🚀 @reactjs @nodejs 🐱‍🏍 GDSC Lead🛸 and Contributor at MDN 🔥