How can we concatenate 2 or more strings in JavaScript?

How can we concatenate 2 or more strings in JavaScript?

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 Imanol Suarez on about.me
I am a web developer, student, and photographer in Trelew, Argentina. Read my articles.about.me